|
| 09 Oct 2012 09:29 PM |
I'm calling it Kaliber. It works like Java and Python, in the sense that the programs compile to byte code which is then read by the virtual machine.
Here are examples of some code:
--------------------------------------------------------------------------------------- Input: --------------------------------------------------------------------------------------- declare:str $name
print:lit "What is your name?: " get:str $name
print:lit "Hello, " print:str $name print:lit "!\n"
pause --------------------------------------------------------------------------------------- Output: --------------------------------------------------------------------------------------- What is your name?: John Hello, John! Press return to continue . . . ---------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------- Input: --------------------------------------------------------------------------------------- declare:num %i assign:num/lit %i 2
:LOOP add:num/lit %i 3 call :disp compare:num/lit %i 35 goto:neq :LOOP
goto :END :disp print:lit "i = " print:num %i print:lit "\n" RETURN :END --------------------------------------------------------------------------------------- Output: --------------------------------------------------------------------------------------- i = 5 i = 8 i = 11 i = 14 i = 17 i = 20 i = 23 i = 26 i = 29 i = 32 i = 35 ---------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------- Input: --------------------------------------------------------------------------------------- print:lit "I like pie" afldld print:lit "what?" --------------------------------------------------------------------------------------- Output: --------------------------------------------------------------------------------------- ERROR:2 afldld _______^ ---------------------------------------------------------------------------------------
Those are just some examples. The language can do an okay amount so far. You can also use "import" to import other files so you can keep your code divided up and not all in one big file.
It runs perfectly fine on Linux 64bit. Windows 32bit seems to display the text a bit strangely. But other than that, it works fine.
Compiler: (Windows 32bit) https://dl.dropbox.com/u/10434417/Kaliber%20Project/0.4/kaliberc.exe (Debian Linux 64bit) https://dl.dropbox.com/u/10434417/Kaliber%20Project/0.4/kaliberc
Interpreter: (Windows 32bit) https://dl.dropbox.com/u/10434417/Kaliber%20Project/0.4/kaliber.exe (Debian Linux 64bit) https://dl.dropbox.com/u/10434417/Kaliber%20Project/0.4/kaliber
I'm still working a lot on this language, and I'll put up documentation on all the stuff it can do once I release like a version 1.
Also, I am not trying to compete with Java or anything. This is just for fun. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 09:32 PM |
I did this with RBX.Lua of course it was strict and low level, but indeed. That is cool too. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 09:39 PM |
@Causticity
ehh.... I don't think you can write a virtual machine and a compiler in RBX.Lua... and that would not be low level, it'd be so dang high level it wouldn't be able to do much at all. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 09:45 PM |
>I don't think you can write a virtual machine and a compiler in RBX.Lua
You can. It might not be good, but nothing is really stopping you.
>and that would not be low level, it'd be so dang high level it wouldn't be able to do much at all.
Such is Lua. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 09:53 PM |
@Jango, tisk tisk. I make a little simple model of basic string matching. Yes, yes you can. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:01 PM |
@Causticity
... This isn't... string matching. It's not a scripting language, it's a programming language. The virtual machine responds by each individual byte. Not by strings. No strings of text even make it to the binary, except maybe when you write something like,
print:lit "Hello, World!"
|
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:08 PM |
| String matching is one of the only ways to do it in Roblox, which I was talking about. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:08 PM |
| I'm pretty sure that scripting language is just a language that is interperated from bytecode instead of compiled to machinecode (Lua does this also), so this is technically scripting, but it's pretty high level. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:15 PM |
@Render No... Java and Python are NOT scripting languages. Bytecode is compiled code to a form read by a virtual machine rather than your actual operating system. It functions like a computer and the code is compiled to that computer.
Scripting languages interpret ASCII text. Like, if I were to write, "pause"
The program would say, "if line = pause ... pause" or something like that.
A programming language, like Java, Python, or in this case, Kaliber, would say, "if line = pause .. append the binary bytecode equivalent to the buffer," which it then writes when compiling the code.
Scripting languages are NOT compiled, because they ASCII is directly read. Bytecode languages, like Java, Python, etc, actually do get compiled. So they are not programming languages.
And saying that bytecode is like a binary scripting language is stupid, because that's what your computer IS. Machine code is just a binary scripting language with a bunch of values that tell the computer to do things. If you've ever programmed in machine code before, you'd understand this quite well. |
|
|
| Report Abuse |
|
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 09 Oct 2012 10:25 PM |
| There really isn't a clear difference between a scripting language and a programming language. Generally a scripting language is one that doesn't have to be compiled before it is run, even though the compiling happens under the hood. Go is a language that compiles straight to machine code like C++ but can also be used as a scripting language since its compiler can act as an interpreter due to its fast compiling speeds. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:30 PM |
| it's ok Jango, I believe in you and your programming language |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Oct 2012 10:31 PM |
>Scripting languages are NOT compiled, because they ASCII is directly read. Bytecode languages, like Java, Python, etc, actually do get compiled. So they are not programming languages.
Nope. So much nope. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:33 PM |
@NecrBumpist
...Yes. Java and Python aren't scripting languages. This is a fact. |
|
|
| Report Abuse |
|
|
|
| 09 Oct 2012 10:48 PM |
@JangoBuffet: If you want to be a pedantic bigot, that's fine, but there are so many inaccuracies in your post.
>Scripting languages are NOT compiled, because they ASCII is directly read.
Lua is well and truly a scripting language, yet it compiles to bytecode.
Hell, even if it didn't, it still wouldn't not interpret raw ASCII values. I don't know of any language that does this. From the hearsay I have encountered, I gather that languages that are interpreted from sourcecode are first parsed into an abstract syntax tree, which is then fed to an interpreter in a similar manner to a bytecode VM.
>No... Java and Python are NOT scripting languages. Bytecode is compiled code to a form read by a virtual machine rather than your actual operating system. It functions like a computer and the code is compiled to that computer.
Languages interpreted on a virtual machine are not separate from the operating system. They would be completely useless in such a situation. The VM acts as an interface between the language and all the low level constructs of the OS.
Now really, look at this: >A programming language, like Java, Python... >Bytecode languages, like Java, Python, etc ... are not programming languages. >Java and Python aren't scripting languages.
Please pick a side already. If they are neither scripting languages nor programming languages, what are Java and Python? |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 09 Oct 2012 11:09 PM |
| I view scripting languages as a subset of programming languages. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 09 Oct 2012 11:12 PM |
"_______^"
That.
If you have it outputting the actual (line,character) position of errors with a marker then you're on the right track for having a very workable codebase for a language. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 09 Oct 2012 11:14 PM |
| And technically both scripting languages and programming languages are "compiled" but scripting languages are generally only run once - at runtime. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 09 Oct 2012 11:14 PM |
* "only checked for errors once - at run time"
and this is because of the lack of static typing etc |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 09 Oct 2012 11:24 PM |
">Scripting languages are NOT compiled, because they ASCII is directly read."
Just to elaborate on this. Even any truly interpreted language (that is, not compiled to any sort of byte code or machine code) is typically first parsed into an AST, and then the AST is interpreted. They are by no means being interpreted directly from the ASCII input. |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 10 Oct 2012 07:28 AM |
| I would never be able to learn this programming language. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 10 Oct 2012 07:50 AM |
| Actually, string matching isn't the only way to make a language using Lua. You can use the OpCodes from a dumped function. |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2012 09:22 AM |
| ^ I said one of the only ways. |
|
|
| Report Abuse |
|
|
|
| 10 Oct 2012 09:31 AM |
| Cool, we're both creating programming languages! I'm personally aiming for a mixture of Lua, JS, Ruby, Java, and C#... but I guess it's just the creator's preference... |
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 10 Oct 2012 10:38 AM |
| I love how the scripters forum discusses retarded things such as this. |
|
|
| Report Abuse |
|
|