This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ComputerCraftFan11's profile picture

[WIP] n00b Programming Language ( Java in lua in Java! )

Started by ComputerCraftFan11, 23 November 2012 - 09:23 AM
ComputerCraftFan11 #1
Posted 23 November 2012 - 10:23 AM


Hello everyone! n00b is a lua programming language that is very similar to java. Most of the variable names and everything else has been taken from java so simple programs coded in java can work.

All the information and variables are stored in a lua table called _N, information about packages and other things are also saved in there.



Hello world program (simple)
Spoiler

class HelloWorld {
	public static void main(String[] args) {
		System.out.println("Hello World!"); // Display the string.
	}
}
( From here )

Download
No exact release date has been planned, and the program is currently 127 lines long, and 3026 letters long.


<None found yet>

  1. xXm0dzXx – main coder
  2. ETHANATOR360 – Beta Tester
( we need a beta tester to find bugs )

Java in lua in java ;)/>/>
billysback #2
Posted 23 November 2012 - 10:48 AM
That's pretty cool ;)/>/>
does it use an external java interpreter? Otherwise how else would it be 127 lines long o.o
ComputerCraftFan11 #3
Posted 23 November 2012 - 10:53 AM
That's pretty cool ;)/>/>
does it use an external java interpreter? Otherwise how else would it be 127 lines long o.o

The full version wont be 127 lines long, and it uses my own java interpreter
Grim Reaper #4
Posted 23 November 2012 - 10:59 AM
I feel that Java might be a little more complex for your targeted demographic. You expect people to find the syntactical strictness of Java to come easier to new CC users than Lua? I'm not saying Java is difficult, seeing as programming just requires practice to understand the language, but Java doesn't seem (in my opinion) to be a better first language to learn than Lua, especially if you're working comfortably within ComputerCraft.
billysback #5
Posted 23 November 2012 - 11:10 AM
Java was my first language, and I would say I enjoy them about equal, java is more complicated (you require more code to do something you can do in lua) but this means you can be more organized and do more things with ease than you can with lua, lua is just easy syntax and short code so it's fun to use ;)/>/> (IMO)
Sammich Lord #6
Posted 23 November 2012 - 12:44 PM
Now just make C# in Lua…
ETHANATOR360 #7
Posted 23 November 2012 - 01:37 PM
epic!!!!!! i will beta test this seems great
ComputerCraftFan11 #8
Posted 23 November 2012 - 07:21 PM
I plan on making a OS pre-installed with this ;)/>/> ( or update my old gaming console called lii ( which sucks ) with it )
ComputerCraftFan11 #9
Posted 23 November 2012 - 07:23 PM
epic!!!!!! i will beta test this seems great

ok, if you want to contact me just message my skype, forums, or check if im on the IRC.
ETHANATOR360 #10
Posted 24 November 2012 - 03:11 PM
I plan on making a OS pre-installed with this ;)/>/>/> ( or update my old gaming console called lii ( which sucks ) with it )
i was planning on asking about using it in my upcoming game console i might just make my own lol
tommyroyall #11
Posted 26 November 2012 - 03:46 AM
So, I have a question. Lets say that someone has this as a statement:

print(functionA(7*6^3+3-functionB(79-81)))

How will you get the recursion to solve that? As you need it parsed up like this:
printing
function A
(with putting through order of operations)
function B
79-81
6^3
7* 216
1512+3
1515-function B which is 79-81, -2, so it's really just 1515+2.
——————————————-
That was the issue that I encountered while trying to make a Lisp dialect xD.
Sammich Lord #12
Posted 26 November 2012 - 03:47 AM
May I be a beta tester?
billysback #13
Posted 26 November 2012 - 03:51 AM
So, I have a question. Lets say that someone has this as a statement:
 print(functionA(7*6^3+3-functionB(79-81))) 
How will you get the recursion to solve that? As you need it parsed up like this: printing function A (with putting through order of operations) function B 79-81 6^3 7* 216 1512+3 1515-function B which is 79-81, -2, so it's really just 1515+2. ——————————————- That was the issue that I encountered while trying to make a Lisp dialect xD.
loop through all of the possible operators, removing them and getting the values either side but remembering what operators were there.
Create a new string with all the real values and operators then do:

return_val = loadstring('return '..sum)()
where sum is the sum as a string and return_val is the result of that.
Mailmanq! #14
Posted 01 December 2012 - 02:31 PM
May I be a beta tester, this will be great for people coming from Java.
Dlcruz129 #15
Posted 06 December 2012 - 06:33 PM
Please explain how java is more noob-friendly than Lua?
ComputerCraftFan11 #16
Posted 06 December 2012 - 06:49 PM
Please explain how java is more noob-friendly than Lua?

Who said that?
Dlcruz129 #17
Posted 07 December 2012 - 01:20 PM
Please explain how java is more noob-friendly than Lua?

Who said that?


n00b Programming Language ( Java in lua in Java! )

^That's your title… :P/>
ComputerCraftFan11 #18
Posted 07 December 2012 - 03:12 PM
Please explain how java is more noob-friendly than Lua?

Who said that?


n00b Programming Language ( Java in lua in Java! )

^That's your title… :P/>

n00b is just the name of the programming language, that doesn't mean its noob friendly
nitrogenfingers #19
Posted 07 December 2012 - 03:38 PM
Java in Lua… so my first question is what does Java do that Lua doesn't?

There's better OO support and reflection, which are probably the two big things I'd like to see, both of which you can do in Lua but not with quite the same dexterity. Wouldn't mind seeing an Lua implementation of the swing libraries either.

I spent a lot of my undergrad poking around in the JVM and scripting up agents for it, so if you need a hand with this let me know. Looks like a fun project :)/>
Mendax #20
Posted 09 December 2012 - 08:41 PM
Is this it?
http://pastebin.com/raw.php?i=m4eNvizN
Tiin57 #21
Posted 09 December 2012 - 11:58 PM
Wouldn't mind seeing an Lua implementation of the swing libraries either.
That would certainly be interesting in Computercraft.
ComputerCraftFan11 #22
Posted 10 December 2012 - 03:40 PM

No, that was gonna be it but then i changed it
RunasSudo-AWOLindefinitely #23
Posted 26 December 2012 - 01:56 PM
eh? Java? n00b? I think you might want to reconsider that name. Java is several steps up from Lua…
immibis #24
Posted 26 December 2012 - 05:36 PM
eh? Java? n00b? I think you might want to reconsider that name. Java is several steps up from Lua…
But this language, which isn't Java, is n00b.
RunasSudo-AWOLindefinitely #25
Posted 31 December 2012 - 11:07 PM

No, that was gonna be it but then i changed it
Good, because if that was your code, then I'd have to do everything I could to kill you so that the code doesn't ever reach the poor eyes of the community.

public class HelloWorld{public static void main(String[] cmdLineArgs){java.io.PrintStream out=System.out;out.println("Hello World");}}
Just broke your code in sooo many ways…
Just saying it might be worthwhile to pursue a different approach to extracting and processing statements.