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

Complete re-write of Lua programming language - Null-Basic

Started by snoble2022, 29 December 2012 - 08:07 PM
snoble2022 #1
Posted 29 December 2012 - 09:07 PM
Null-Basic Thread
Null-Basic will be a complete rewrite of the Lua programming language but will operate on-top of the ComputerCraft Lua console. To explain this further think of this, Microsoft visual C++ is still the C++ language but with more APIS, slightly changed functions, etc. Null-Basic will be the language Null-Void OS© will be written in. However, just because its designed to work with an OS doesn't mean you need that OS. That's right, Null-Basic is stand-alone (inside ComputerCraft) and needs no additional things to run! Null-Basic is meant to extend the Lua programming language, yet still change it completely!

Theory of Null-Basic©:
SpoilerA null-basic program will consist of at least two-files, one in pure lua (even though null-basic is standalone I can't make it run itself, and running a program in ComputerCraft requires Lua) and another in Null-Basic (to see the schematic file for launching your program in null-basic look in the "Null-Basic Launcher" spoiler). The null-basic interpreter will read your program in binary (So your program will have to be compiled into binary via StrUtils(can't remember who made StrUtils, just look up string utils on the threads, credit will be given when I find out).

Null-Basic Execution process:
1) Interpreter reads your file and decompiles it from binary then saves it to a temporary file.
2) The now in Decompiled code in the created temp file is executed via the interpreter.
3) After running your program the Null-Basic interpreter searches the temp dir for any temporary file and deletes them

Null-Basic launcher:
SpoilerThis code must remain the same in order to launch your file. However, when executing another Null-Basic program inside a Null-Basic program there will be a separate function.


if fs.exists(".Null_Basic/interpreter/intmain") == false then --If the Null-Basic interpreter doesn't exist then get it
   if http then
	   fs.makeDir(".Null_Basic")
	   fs.makeDir(".Null_Basic/interpreter")
	   fs.makeDir(".Null_Basic/temp_dir")
	   shell.run("pastebin", "get", CODE_NOT_YET_CREATED, ".Null_Basic/interpreter/main")
   else
	   error("Please acquire Null_Basic from its respective forum or connect to http")
   end
end

os.loadAPI(".Null_Basic/interpreter/intmain") --Loads the interpreter

main.launch("PATH_TO_YOUR_PROGRAM") --launches and decompiles your program


Confirmed features:
Spoiler

-A Null-Basic compiler will be created
-Can still do the same things as Lua (probably more)
-Some Lua apis will remain the same (so far thats GPS, coroutine, vector, parallel, disk, math, bit, table, and keys)
-Loading an API will be like so
 import(sAPIpath) 

-You can still make your own APIS however they cannot be in Null-Basic, they will have to be in pure Lua
-A 'Standalone' interpret
-I will make a developer interface for Null-Basic (If anyone knows how to make Notepad++ plugins let me know that way we can have an external editor). But in the mean time I will make an in-game Null-Basic editor and compiler that features things such as a clickable GUI, high-lighting (maybe), etc. For example on something similar, take a look at the taco editor (http://www.computerc...__fromsearch__1).



sneak-peak:
SpoilerWarning, code posted in this spoiler is usually untested and is only meant to give you guys an idea on whats this is going to be!
Note: If you want to comment on this do not put any of the code in the comment, if you want to report a bug in my code (and need to put a piece of code in) then PM it to me. Acctually if your going to PM me an error you must give the whole section of code as this will change everyday!
http://pastebin.com/sR1cy5nm
Please, post your thoughts on this! Tell me what I should include in it, tell me if i'm breaking the law o' Lua by re-creating Lua in Lua. Null-Basic will be great only if I have the proper support! Also, developers will be needed after the creation of Null-Basic to create Null-Void OS©, refine Null-Basic©, etc. See the Roxororic Engineering© forum (look up on fourms, its easy to find) to apply as a tester, developer, or contributor.
Cloudy #2
Posted 29 December 2012 - 10:26 PM
Please remove your stupid disclaimer - or at least spoiler it. It is likely just to cause a flame war.
Mikeemoo #3
Posted 29 December 2012 - 11:31 PM
Really really really trying to resist….

/me turns off laptop and kills power to the house…

Must. not. reply.
cvbbot #4
Posted 29 December 2012 - 11:45 PM
Not proud of this as my first post…
But those letters hurt
It hurts my eyes, dammit
Mads #5
Posted 30 December 2012 - 01:13 AM
What kind of retarded copyright notice is that?
Dlcruz129 #6
Posted 30 December 2012 - 07:42 AM
Do you honestly think anyone would try to steal code? Get rid of your stupid copyright notices.
snoble2022 #7
Posted 30 December 2012 - 08:08 AM
Alright if no one will steal the code then *poof*
Mendax #8
Posted 30 December 2012 - 01:34 PM
Funny, I wrote a BASIC interpreter about a month ago (I don't really care if you use my code as a base (Good luck reading it), it wasn't really that finished. (Just give a little credit))
snoble2022 #9
Posted 30 December 2012 - 01:42 PM
Thanks Mendax for the offer, but no thanks. The Basic in the name isn't really a reference to BASIC, it's more of a name I came up with. But again, thanks for the offer!

Note to all readers:
Check the sneak-peek spoiler to see code that changes from time to time as I finish developing Null-Basic! (As of this post it's the clear function)
Mads #10
Posted 30 December 2012 - 11:40 PM
Lol, good luck using variables in lang.xxx.xxx when you haven't made a table for it…
RunasSudo-AWOLindefinitely #11
Posted 13 January 2013 - 09:56 PM
Protip for programming: large walls of copyright notice can be replaced by three words:

Licensed under GPL.