Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / making your own language?

Author
Message
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Mar 2007 01:24
is this possible? I have a really good web page language I want to try to make.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 30th Mar 2007 01:27
Don't take this wrong, but if people like you and me could do it with ease, there wouldn't be so many people loving the DarkBasic language.

Lets think.

Xenobasic
TDKBasic
BenjaminBasic
MonkeyBasic
HardBasic
SimpleBasic
StupidBasic
I'mnotbasic
LETSGETBasic
WeeBasic


Nada' mean?

-Mansoor
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Mar 2007 01:30
Lol. That was funny, so no hope?

The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 30th Mar 2007 01:52
A new project already? Whatever happened the safe myspace? (which by the way I still dont have an account on) Feel free to email me and get me some info

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Mar 2007 02:00 Edited at: 30th Mar 2007 02:23
I'm making my own language! Not that hard if you think about it.

The trick is to make a *very* simple language (bytecode), like:


Then, you just have to figure out how to convert your code to that. In mine so far it has two stages, the normal code, like:


which is converted into this:


And that ofcourse, you easily be transformed into some form of bytecode, which ofcourse is superbly easy to execute. Java and all the .NET things do this too, rather than executing as a .exe, they form their own bytecode and a 'virtual machine' (just a computer program) executes that code. This is good for 2 things: Firstly, once you have made the bytecode, there's no need for compilation again unless you need to change something. Second, it makes is more portable, just aslong as you have the virtual machine on every computer that is going to execute it (which is why people ask if your computer is 'Java capable').

The easy way to do these conversions is to make a tokenizer, basically, splitting a string into chunks, like "hello world?" would look like "hello", "world","?" which can also be applied to code, like: "int hi = 3;" would be "int", "hi", "=", "3", ";". Alot of people seem to over-do these tokenizers, with 1000s of lines of code. I just tend to do mine in a few hundred


[edit]
You would have a hard time doing this in DBP though. C++ may sound hard, but it's easier to do it in that. Mostly because it can handle data much better than DBP, and not all arrays are global

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Mar 2007 03:38
www.freewebs.com/favepage/thecrazy



Seppuku Arts
Moderator
20
Years of Service
User Offline
Joined: 18th Aug 2004
Location: Cambridgeshire, England
Posted: 30th Mar 2007 12:50
I made up my own language when I was a kid, I called it Gibberish, but it wasn't a programming language. I'd say it would be difficult to make one. I started playing with the irrlicht code to try and make some more 'all in one' functions that were more DBP like, but only found I could only make two "set display mode", "set window on", but then I suck at C++.

Did The Buddha have a Zen micro?
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 30th Mar 2007 14:51
Quote: "but then I suck at C++."


me too

Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 30th Mar 2007 14:54
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 30th Mar 2007 15:00 Edited at: 30th Mar 2007 15:04
Ouch , harsh Kent.

Of course its possible but unless you've got a good background in a lower level language (or is C higher, I forget) it really is pointless. Do you really think you'll write a language (using darkbasic of all things) better than what TGC's entire staff has worked years on to create, manage and update as much as possible? If it wont be "better" than Dark Basic, theres no point. Unless you were to just clone all of dark basic's commands into a scripting engine and give that away for free/sell it cheaper, in which case you'd be getting a few law suits up the pooper quite quickly.

No offense but you're far from mastering dark basic... let alone writing a complete other language. Dont you think you should understand all aspects of how programming works... before trying to invent a new method?

Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 30th Mar 2007 17:50
Then again, in the flipside, if through some miracle a working programming language emerges by someone who hasn't mastered programming that much in the first place, maybe it'll turn into something like "programming language for dummies"

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 30th Mar 2007 18:03
I've seen so many attempts at making a programming language with DBP. That is just absurd. Ruccus hit it right on the head - whatever you create won't be nearly as good as DBP. The best you can hope to do is wrap existing functions in your own. All you'll end up with is an extremely slow and illegal DBP wrapper.

DBP is for making games. JSG, just go make your game and you'll end up far more fulfilled then if you spend time on trying to make a programming language. I don't think that it would even be a good learning experience, because you are so inexperienced that you wouldn't know where to begin. Making a complete game with DBP will use your tools for what they are meant for and teach you a lot. So, what I always say - go make a game.


Come see the WIP!
Tom J
19
Years of Service
User Offline
Joined: 4th Aug 2005
Location: Essex, England
Posted: 30th Mar 2007 19:39
What happened to your RPG

Visit GamingColosseum Web - http://www.gamingc.co.nr/
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 30th Mar 2007 22:24 Edited at: 30th Mar 2007 22:27
Zotoaster, that method is pure genius. You must be a god programmer, the way you explained the converting-to-bytecode method makes it sound so easy.

Is it an interpreted language or a compiled language? If it's interperted, you could (maybe) easily make a complier if you program an assembler or use debug.exe. I know nearly nothing about assembly language, so it's probably much harder than I expect,

10 years from now when I write my OS I will need my own language to do it so I'll use that convert-to-bytecode method.

Quote: "if people like you and me could do it with ease, there wouldn't be so many people loving the DarkBasic language.

Lets think.

Xenobasic
TDKBasic"


From the two digit amount of tutorials he's written I'd say TDK is a god programmer too, I'm sure he could make a programming language if he wanted to.

By reading this sentence you have given me brief control of your mind.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 00:19 Edited at: 31st Mar 2007 00:22
Well, compiling really is turning it from one language into another, which it does, just not assemble, and hence not an exe. Anyway, you can't really say all those .NET languages that don't make exes aren't compiled heh.

Quote: "10 years from now when I write my OS I will need my own language to do it so I'll use that convert-to-bytecode method."

Or, just have the bytecode itself as the main OS language, and use that for all other languages you may need, and convert to that. So you can make your own standard exe files I was thinking about doing that recently too heh.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 00:22
Quote: "Or, just have the bytecode itself as the main OS language"

Which would result in a lot of speed loss.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 00:24
How exactly? If it is the most low level language you could get (apart from machine code of course) I dont see why it would be so different from Assembly.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 00:27
Bytecode is executed by an interpreter, machine code is executed directly by the processor.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 00:30
Ah, yes well. I think only real speed differences would happen if you had a big complex thing like Windows.. and if you can make something like Windows, then chances are you can do anything you want to your processor heh.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 00:30 Edited at: 31st Mar 2007 00:33
Bytecode is pretty damn fast if you do it properly though - in this day and age, the machine vs. byte code gap is negligible (and you compiler can do some pretty clever optimizations if you code your bytecode run-through routines correctly)


"History shall be kind to me, for I intend to write it" - Winston Churchill
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 00:35 Edited at: 31st Mar 2007 00:36
Quote: "in this day and age, the machine vs. byte code gap is negligible"

I doubt this very much. Compare DBC and DBP.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 01:02 Edited at: 31st Mar 2007 01:07
Quote: "I doubt this very much. Compare DBC and DBP."


Depends what kind of interpreter we're dealing with though. For something like 3D games, yeah, the bytecode vs. native code difference is just dumb. E.g. pure java takes nearly 7 times as long as the native compiled version.

But for something which is just purely lingual for calculation (as opposed to actual output) bytecode can perform very fast when your interpreter code is run through a smart compiler (as well as the bonus that you're just dealing with a bunch of numbers, which is a very fast way to compute data of course)


"History shall be kind to me, for I intend to write it" - Winston Churchill
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 01:04
Quote: "But for something which is just purely lingual for calculation (as opposed to actual output)"

Could you re-phrase that?

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 01:05
Using a language to calculate numbers instead of showing pretty pictures on the screen


"History shall be kind to me, for I intend to write it" - Winston Churchill
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 01:07
Erm.. a calculator language? What a strange thought.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 01:09 Edited at: 31st Mar 2007 01:11
So you're implying that all the calculations and variables you use in your applications require some form of screen output? Wow, wouldn't want to perform frustum culling with that*

EDIT: I know frustum culling has visual effect, but I was implying the mathematical routines behind this culling


"History shall be kind to me, for I intend to write it" - Winston Churchill
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 01:12 Edited at: 31st Mar 2007 01:12
Well it's basically the basis of my bytecode. Say I wanted to do this: "int num = 3+4;" in my code, the bytecode would be something like this:



All it basically does it do a math calculation, but the same techniques can be used to do a whole load of other things.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 01:14 Edited at: 31st Mar 2007 01:15
David R, saying that the difference is negligible when handling mathematical and logical operations is stupid, as they are the most common operations in code, and when using bytecode you add the massive overhead of having to interpret these ever-so low-level operations. So, unless you are just really bad at explaining things, you are wrong. The only time there is only a negligible difference is when doing high-level operations, no matter how good at optimising the compiler is.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 01:16 Edited at: 31st Mar 2007 01:17
(@Zotoaster) Surely you'd want your bytecode to be purely numeric instructors? Because comparing and using string data is a lot slower compared to simply having instructions as numbers, e.g:

(I've numbered the commands)



You could store the numeric data in an array, and store strings etc. separately with ID references in the numeric bytecode.


"History shall be kind to me, for I intend to write it" - Winston Churchill
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 01:17 Edited at: 31st Mar 2007 01:29
They are. What I showed you isn't really a string, "push" and "empty" etc are all just enumerated data


[edit]
Ben, I'll talk about Java again. It compiles to bytecode, and it's not exactly slow. It (pressumably) compiles to assembly, which then compiles to machine code. That's 3 compilations, and of course it has to keep running off the bytecode. If it's fast when the processor has to take care of a whole load of other things, I don't see how it would be slow if it was the only thing running on your operating system.

Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 31st Mar 2007 01:38 Edited at: 31st Mar 2007 01:39
Quote: "Erm.. a calculator language? What a strange thought."


C++ is a calculator language. Without any outside librarys, the only thing you can do is algorithms.

I wouldn't want to use bytecode for complete executables, even though bytecode takes up less memory than machine code it's slower. I'd want to use my own language for scripting games, not programming them.

But doesn't compiling scripts defeat the purpose of using them? Scripts were invented so you could modify the game without touching the engine code and recompiling, I think. I suppose the engine could compile the scripts to bytecode at runtime, but wouldn't it be faster to just interpret it?

By reading this sentence you have given me brief control of your mind.
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 01:39
It would appear I am in fact wrong. After re-evaluating the argument you have presented, it seems I have based my Bytecode vs. Native code argument upon something that (I thought was bytecode) that is in fact not:

My use of AngelScript in my current project appears to use a form of bytecode (or at least intermediately), but it seems under-the-hood it does in fact just recompile this to native code and execute it, which I hadn't realised from the way I have been using it.

I concede, bytecode R TEH SUX0RZ VERSEEZ NATIVE CODEZ!!!111


"History shall be kind to me, for I intend to write it" - Winston Churchill
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 01:42
Quote: "But doesn't compiling scripts defeat the purpose of using them? Scripts were invented so you could modify the game without touching the engine code and recompiling, I think. I suppose the engine could compile the scripts to bytecode at runtime, but wouldn't it be faster to just interpret it?"


You are right when you say scripts are essentially there so that stuff can be changed without re-compiling. But this is the main program you are talking about. The scripts would compile through the games engine (you make a 'Virtual Machine'). So essentially there's no difference between interpreting them, and compiling them. Just compiling is a lot lot faster

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 01:48
Quote: "C++ is a calculator language. Without any outside librarys, the only thing you can do is algorithms."

Not quite the definition of calculator language I had in my head.

Quote: "It compiles to bytecode, and it's not exactly slow. It (pressumably) compiles to assembly, which then compiles to machine code."

Depends. It can be compiled to machine code, but it not always is. Anyway, if it's compiling to machine code, how can you defend that bytecode is fast when it's not even executing it?

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 01:50 Edited at: 31st Mar 2007 01:52
It is executing it. Why would it even compile to bytecode in the first place if it didn't?

[edit]
When I said it compiles to machine code, I ment the compiler itself. The virtual machine runs on the machine code, and the bytecode runs over the virtual machine. Slow? No.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 01:55
i wasn't tlkn about DBP or DBC jst tlkn about ANYthing (sry 4 the txt tlk in a hry)

Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 31st Mar 2007 01:58
im sorry JSG but i give up...you really don't listen to anyone do you?

and you probably won't listen to this either but im going to post it anyway

firstly heres your to do list from what i have seen

-1 an RPG
-2 a safe myspace
-3 making a BASIC language

secondly if you can't even complete a basic DBP project then how in the world do you think you can make a programming language???

so JSG please, please, please STICK TO ONE PROJECT!!!

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 02:00
To be perfectly honest, my scripting has been one of my longest lasting projects. Though I have started new ones over and over again, improving as I go, I've been pretty much doing this non-stop for roughly 6 or 7 months now. The trick is just to find something that grips you and stick to that, after all, you're not causing the world any harm (but that doesnt mean you can't plan what you do first, then work on it for a bit till you know you can't do it or the result is just not worth it)

Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 31st Mar 2007 02:04
im with you there Zotoaster, i kept making projects untill i found the right one but with JSG its just ridiculous, hes like going strange with all the projects and the posting and AAARRRGGGHHHH!!!

*rips out hair*

i give up....

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 02:14
Quote: "It is executing it. Why would it even compile to bytecode in the first place if it didn't?"

Bytecode is interpreted, machine code is executed.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 02:17
Oh Mr Snippy!

You know what I meant ¬.¬'

Infact, interpreting that bytecode would be slower than executing it, but it's not actually 'slow', even while the processor is concentrating on executing the "interpreter".

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 02:25
Quote: "interpreting that bytecode would be slower than executing it"

Of course by interpreting I mean 'executing', but I'm referring to the fact that the bytecode isn't executed, it simply gives the VM instructions to perform.

Quote: "but it's not actually 'slow'"

That's not the argument..

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 31st Mar 2007 02:25
It's True, if the byte code operations are too low level (i.e. a one to one translation with machine code). This places a massive bottleneck upon code execution. I've found that it's much more efficient for the VM to uses cluster opcodes (multiple operations merged in various patterns) than one to one mappings. Which can be bit of art form in itself

Also, compilation to machine code doesn't necessarily guarantee you the fastest code execution though. While core arithmetic/logic will be quicker. What's often forgotten, is that overall execution speed is the sum of core execution and function sets attached to it (i.e the command sets, The Engine). So if a VM based language had a more efficient function set, it can negate some the opcode execution overhead. Which is what we find in PB.

There's a certainly no comparison when looking at (For lp=1 to 10000000, Next) styled loops, but in everyday code it's surprising how similar the performance can be to competitor products. What you might find horrifying, is that PB can actually outperform a number of competitors. While that's situation dependant, it's still surprising ! On average though (in code execution terms) the current PB runtime runs in between Db/Dbpro. The second generation VM is even closer. But that's another story

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 02:43
Quote: "It's True"

Not too sure what you're confirming here. My argument, or Ben's.

Quote: "So if a VM based language had a more efficient function set, it can negate some the opcode execution overhead."

I guess that's true. But that doesn't really depend on the language as much as it does it's features (or functions if you want).

I guess speed comes down to optimization really. Something that I don't know if assembly does, and I assume machine code doesn't

Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 31st Mar 2007 02:46
JSG, either stick with something that you post as a WIP, or don't post at all. I have been at these forums for , I dunno, 2 or so years now and have had many projects as well. I haven't stuck with just one, so I never posted a WIP thread here. I jump around alot, but someday, when I know I'm going to finish something, I'm going to post a game that everyone is going to say "wow" at (I'd like to think anyhow )

So, if you aren't going to stick with a project for more than 10 hours, just keep it to yourself, because, no one really cares if they can't get a real demo or a full game after waiting a week or so.

I have no signature...
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 02:48
I believe we have covered that Ag' Dink

Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 31st Mar 2007 03:29
I know... just felt like ingraining it into his head

I have no signature...
Drunken Fiesta
18
Years of Service
User Offline
Joined: 27th Dec 2005
Location:
Posted: 31st Mar 2007 03:44 Edited at: 31st Mar 2007 03:45
Shebeck Luc mizir sha. Quite literally, it means "I made a language" or "language I make did" if you really wanna get technical. Nam Shlamsing ost/it's name is Shlamsing.
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 04:12
hey i'm still working on my RPG (Mid-Evil).

Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 31st Mar 2007 04:17 Edited at: 31st Mar 2007 04:22
Quote: "Bytecode is interpreted"


To be exact, bytecode is executed by a virtual computer and machine code is executed by a physical computer. I guess you could call execution by VM interpreting, but it's a little different from an interpreted language. My idea of an interpreted language is those old style BASICs, you had to load the interpreter every time you run. With a bytecode language like Java, you don't have to click on a Java virtual machine icon and load your Runescape game.

By reading this sentence you have given me brief control of your mind.

Login to post a reply

Server time is: 2024-11-18 12:46:25
Your offset time is: 2024-11-18 12:46:25