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
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 31st Mar 2007 04:19
I would love to work on my language again. I built something called GameBasic in 2004-2005 for my final degree project and got an A+. It was pretty good-- used DirectX 9 and its own snazzy IDE. I made several showcase games including a Pong and a spaceship shooter. Ahhh--- those were the days I did it in C# and I would do it in C++ if given the choice again.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 04:21 Edited at: 31st Mar 2007 04:22
It's simply a matter of terminology. To me, executing bytecode and interpreting bytecode is the same thing.

Quote: "I would love to work on my language again."

I so would love to write my own language. Shame I don't really have the time...

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 04:23
shame i still don't know how..................

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 04:23
Would an interpreter not only really be for strings anyway? As I said, my bytecode isn't just any old code that you can program. It's just a pile of data with subdata, and each "command", like 'push', is just part of an enum, like:

So you see executing that wouldn't even be as slow as interpreting. I actually think it would be pretty damn fast.


Jeku:

GameBasic?

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 04:35
GameBasic?

Hey mine called PAGE for websites.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Mar 2007 05:11
All this talk about bytecode and nobody's mentioned Java?

JSG, if you don't know C/C++ then you're gonna have a lot of trouble making you're own language.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 05:13
Quote: "All this talk about bytecode and nobody's mentioned Java?"

Yeah we spent a few pages talking about how much Java sucks.



Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 31st Mar 2007 05:25
Quote: "
Jeku:

GameBasic?"


Yah--- it was an interpreted language, but it was still pretty good. It didn't compile to EXE--- you had to run the games in the IDE. However, you could load in .X models or create your own using DBP-type primitives (box, sphere, etc.) then paint them with colours and textures. It also supported keyboard input, sound, and timers so one could potentially make a nice game with it.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 31st Mar 2007 06:55
Quote: "hey i'm still working on my RPG (Mid-Evil)."


its almost as if he skips over every single post... clueless.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 31st Mar 2007 08:16
Quote: "hey i'm still working on my RPG (Mid-Evil)."

It's Medieval, and @RUCCUS: I think he only responds to what he wants to and ignores the other 20 posts.


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 31st Mar 2007 08:32
Quote: "Yeah we spent a few pages talking about how much Java sucks.
"


wha? rubbish!

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 31st Mar 2007 08:42
Quote: "It's Medieval,"

It could be a play on words, that's what I took it for at least.


Come see the WIP!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 31st Mar 2007 09:21
Quote: "i wasn't tlkn about DBP or DBC jst tlkn about ANYthing (sry 4 the txt tlk in a hry)"


Anyone else think that's the stupidest reply ever?

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 31st Mar 2007 11:43
I'm trying to be less of a jerk. It's hard, because the funniest meanest things always pop into my head immediately and I have to swallow them down like acid indigestion.

Perhaps this thread set him on track.


Come see the WIP!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 14:38
Quote: "Yeah we spent a few pages talking about how much Java sucks.
"


If by we you mean you then yeah

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 14:54
Quote: "pure java takes nearly 7 times as long as the native compiled version."



"History shall be kind to me, for I intend to write it" - Winston Churchill
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 16:59 Edited at: 31st Mar 2007 17:02
No it is still Mid-Evil (it is a play with words) like Cash said.

JAVA is only good for blogs.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 17:03
Quote: "JAVA is only good for blogs."


Wah!? Is Java even used for blogs? Or are you confusing java with javascript?


"History shall be kind to me, for I intend to write it" - Winston Churchill
John Y
Synergy Editor Developer
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 31st Mar 2007 17:12
An interesting read. http://kano.net/javabench/

Get the new DarkBasic Professional IDE for only $19.99/~£9.85
Http://synergyide.thegamecreators.com
Http://www.digitalzenith.net
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 31st Mar 2007 17:14
Quote: "pure java takes nearly 7 times as long as the native compiled version."

Hahahahahahahahahahahahaha. Ha. Now give me something to actually prove that. Java nowadays is only somewhat slower than native code, and even less so when using a JIT compiler. If it was so slow, why is it the most popular programming language?

http://www.tiobe.com/tpci.htm

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 31st Mar 2007 17:20
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/39585


"History shall be kind to me, for I intend to write it" - Winston Churchill
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 31st Mar 2007 17:35
I would have liked to see that done with longer tests, where the java startup time would be less significant in the totals. It's also taking java out of context, it's not made for smaller apps, but for transaction systems, which are large and need a lot more complex, which is where it really comes into its own.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 18:20
oops. javascript. sorry.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 31st Mar 2007 18:31
Jordan,
You will not be able to make your own programming language. What every one is trying to say is: stick to 1 project. An RPG is also a very hard task to accomplish. Please at least try completing that 1 project before going on to anything else

-Mansoor
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 19:35
ok.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 31st Mar 2007 19:43
Cool I'm very glad you understand Jordan. Good luck with the RPG! If you ever have any questions, feel free to ask me on MSN

-Mansoor
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 20:43
i'll add u.

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st Mar 2007 20:53
I like the way David R quoted something to infer that it sucks.

Quote: "If by we you mean you then yeah"

Yeah, shame on you for not mentioning it.

Quote: "If it was so slow, why is it the most popular programming language?"

Because it's cross-platform?

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 21:24
Quote: " Not too sure what you're confirming here. My argument, or Ben's."


Ben.

Quote: " 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)."


If you strip out functions and purely compare memory access / math / logic / comparisons and control structures, then a purely interpreted VM hasn't got a hope a hell against even the sloppiest native code. JIT is another thing however.

When then VM interprets opcodes, it basically pulls it from memory, calls the decoder (via jump table hopefully) and loops back.

Ie A bit like this ( pseudo decoder)


So just for examples sake, lets assume this is a perfect world and the decoder loop executes one byte code call (just call) in 5 clock cycles. If the VM's instruction set was a 1 to 1 mapping with the host cpu (like you'd see in an emulator say) the best we could possibly hope for in terms of performance would be a 1/5th (cough more like a 1/10th.) of the native execution.

Obviously to improve performance, the VM instruction set needs to be aimed at a higher level than a 1 to 1 mapping, but low enough to retain flexibility. Above that, the compiler needs to be intelligent enough to streamline code generation, so it only outputs necessary opcodes.

The fantasy of every interpreter writer is to come as close to native code execution as possible (across the board), but without JIT that's just fantasy.



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


Yes assemblers have instruction level optimizations. Which not only includes trivial exchanges, but often the ability to lay instructions/memory accesses out in more processor friendly manner.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 21:52
Quote: "then a purely interpreted VM hasn't got a hope "


But not all bytecode is interpreted, right? Because mine aint.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 31st Mar 2007 21:55
must not be if yours isn't.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 31st Mar 2007 22:53
That can either mean that I am using a different method or I have invented something new Or I am actually just using bytecode heh.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Apr 2007 00:39
Well how are you running your bytecode if you're not interpreting it then?


"History shall be kind to me, for I intend to write it" - Winston Churchill
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Apr 2007 00:42
he must've invented something new... wow.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Apr 2007 00:45
Well, I guess I am, seeing as what I basically do is "if you happen to see the 'push' thingie, please add its data to that stack you see over there". But still, it's not in string form, just enums and stuff.

Actually, I have just got to the point of converting it to bytecode. Actually running it is not hard, but I have to figure out how to convert:


Into:


I am in for a fun night tonight

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Apr 2007 00:47
Quote: "Well, I guess I am, seeing as what I basically do is "if you happen to see the 'push' thingie, please add its data to that stack you see over there". But still, it's not in string form, just enums and stuff."


Well yeah, that's exactly what an interpreter is; taking data from the byte code and interpreting it into something else


"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: 1st Apr 2007 00:49
Yeah, but it should be faster than your regular interpreter, because, a) It doesn't need to tokenize strings, and 2) No string comparisons, like "if (cur == "nint")" (strings like that are more than a byte anyway). Yeah, everything is purely numarical.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 1st Apr 2007 00:50
It's just a bytecode interpreter though... still just an interpreter :p


"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: 1st Apr 2007 00:52
Yeah.

I think I'll make the interpreter before the conversion.. It doesn't look too friendly. Luckily the instruction code (shown in my first post in this thread) will make it alot easier.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Apr 2007 00:57
i can garuntee any language you use isn't friendly, good luck.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Apr 2007 01:01
I'm talking about the bytecode heh. I'm alright with how C++ will treat me, just not how my code will

I wont code the interpreter first, incase there are any changes that need to be made that I have missed, while I code the compiler.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Apr 2007 01:07
oh, oops.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Apr 2007 01:35
For anyone actually interested in making a programming language for DBPro, here is a *very* simple thing I made. It basically works like bytecode, but it's a string (which is still bytecode I would say, just not "byte"code)



Might post it in Code Snippets.

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Apr 2007 01:38
like my sig? it fits me doesn't it?

Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 1st Apr 2007 06:31
suits you very well...thats why it deserves to stay

Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 1st Apr 2007 16:40
i would get offended but no, it does suit me.

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Apr 2007 18:25
Quote: " But not all bytecode is interpreted, right? Because mine aint. "


No, but what you've described in this thread is an interpreter. Regardless of terminology, If you translate from Source form into some type of intermediate state (i.e byte code, tokenized), which requires any form of deciphering in order to act this code out (execute it), then it's an interpreter.

I get the impression that you believe that interpreters work in source form only, which is just not the case. Sure, there must be languages that work like that (even today), but the majority of basic interpreters use some type of tokenized form. Even old school dialects (on 8bit clunkers) do, but you had to in those days...

Previously when I mentioned instruction mapping, I was referring to how many byte code instructions are used to act out a single high level operation. This is critical for core operations (functions less so) as the VM will often spends more time deciphering the instructions, than executing them (acting it out).

The temptation is to make the VM instruction set as low level as possible (ie. approaching an assembly mapping), while this can make some things easier, the down side is that in order for the VM to execute simple operations of high level code, it requires multiple passes through the vm.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Apr 2007 18:33
I guess the reason I thought that interpreters only work with sources is because, when I was trying to find out more about bytecode, I went on Wikipedia and found the Java bytecode. It said that some people actually just program in it - source form

Quote: "it requires multiple passes through the vm."

I'm not too sure what you're saying here. Why would it need more than one pass?

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 1st Apr 2007 19:14
If this,



Translates to,



Then this obviously requires four passes thought the VM in order to decphier the four opcodes. If each opcode resolve costs 5 cycles (in a perfect world again ) then that's there's 20 cycles VM overhead, on top of the operation expense.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Apr 2007 19:23
Oh.. I would've though the VM would just loop through all the codes and execute them one by one, rather than only execute one at a time.. Well, that's what mine will do anyway

P.S. 100th post

Login to post a reply

Server time is: 2024-11-18 12:29:24
Your offset time is: 2024-11-18 12:29:24