#1
Posted 30 November 2012 - 01:47 PM
#2
Posted 30 November 2012 - 02:49 PM
In any event, moved to General.
#3
Posted 30 November 2012 - 02:52 PM
#4
Posted 30 November 2012 - 03:33 PM
Dlcruz129, on 30 November 2012 - 02:52 PM, said:
#5
Posted 30 November 2012 - 08:00 PM
#6
Posted 30 November 2012 - 09:27 PM
#7
Posted 01 December 2012 - 06:38 AM
#8
Posted 01 December 2012 - 09:40 AM
#9
Posted 01 December 2012 - 11:31 AM
D3matt, on 30 November 2012 - 09:27 PM, said:
custom inturpreters/compilers are hard to make, its still possible though
#10
Posted 01 December 2012 - 02:14 PM
#11
Posted 02 December 2012 - 04:10 AM
PixelToast, on 01 December 2012 - 11:31 AM, said:
D3matt, on 30 November 2012 - 09:27 PM, said:
custom inturpreters/compilers are hard to make, its still possible though
#12
Posted 02 December 2012 - 04:35 AM
2- Write a function for each command that you will use
3- Make a splitter and a reader
4- pass the commands to the functions
#13
Posted 02 December 2012 - 08:59 AM
D3matt, on 02 December 2012 - 04:10 AM, said:
PixelToast, on 01 December 2012 - 11:31 AM, said:
D3matt, on 30 November 2012 - 09:27 PM, said:
custom inturpreters/compilers are hard to make, its still possible though
and assembly is compiled into bytecode
bytecode is hardware level, not C
#14
Posted 02 December 2012 - 11:08 AM
D3matt, on 02 December 2012 - 04:10 AM, said:
PixelToast, on 01 December 2012 - 11:31 AM, said:
D3matt, on 30 November 2012 - 09:27 PM, said:
custom inturpreters/compilers are hard to make, its still possible though
The implementation of Lua ComputerCraft uses is written in Java, And then Java is written in C/C++, Now tell me that isn't a language written in another language written in another language.
#15
Posted 02 December 2012 - 11:45 AM
tomass1996, on 02 December 2012 - 11:08 AM, said:
D3matt, on 02 December 2012 - 04:10 AM, said:
PixelToast, on 01 December 2012 - 11:31 AM, said:
D3matt, on 30 November 2012 - 09:27 PM, said:
custom inturpreters/compilers are hard to make, its still possible though
The implementation of Lua ComputerCraft uses is written in Java, And then Java is written in C/C++, Now tell me that isn't a language written in another language written in another language.
Languageception... But what about SScript? A language in a language in a language in a language.
#16
Posted 22 April 2013 - 10:01 PM
Dlcruz129, on 30 November 2012 - 02:52 PM, said:
#17
Posted 22 April 2013 - 10:58 PM
-- Produce a syntax tree for this code:
--[[
x = 12;
print(x, something_else)
]]
tree = {
{
_type = "def", -- It is a definition
_left = "x", -- The left variable
_right = 12
},
{
_type = "call",
_func = "print",
_args = {"x", "something_else"}
}
}
Then you'd create a register of variables, with information about types and values and what not. I think that the hardest part will be parsing it.
#18
Posted 23 April 2013 - 07:45 PM
http://wiki.sk89q.co...i/CommandHelper
#19
Posted 23 April 2013 - 08:17 PM
#20
Posted 23 April 2013 - 10:50 PM
PixelToast, on 02 December 2012 - 08:59 AM, said:
and assembly is compiled into bytecode
bytecode is hardware level, not C
Bytecode is then interpreted by the Java VM, it can't run on its own.
Assembly is compiled into object code, which is usually machine code instructions.
@Pantomchap:
In principle you could create a programming language on top of Lua.
But it will be very slow, will not have hardware access and might not have all the necessary standard features.
Also it would need Lua to run, or possibly even CC Lua specifically, because of the way how it does some things differently.
All in all it wouldn't be worth the time, as you wouldn't get anything seriously useful out of it.
As an experiment it might be interesting to do. But I'd rather make some kind of parser that converts one thing into another, that might be much more useful.
Creating a programming language on top of CC Lua is like putting a bike on top of a car, which already stands on top of a truck.
The space in which to operate becomes ever smaller, the speed you can gain becomes less and less, your ability to get access to stuff on the road becomes less and less, etc.
But even if you didn't have these limitations, creating a serious programming language is no easy business and a science of its own.
If you aren't a programming wizard with some of the more serious programming languages already, then it's like trying to dig a tunnel through a mountain armed with only a spoon.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











