jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:37:48 PM |
|
Below is a "Hello world" program adapted from Lawrence Woodman helloworld.sq [10]. It is exceptionally terse, but is a good example of Subleq efficiency. L:H (-1); U L; U ?+2; Z H (-1); Z Z L . U:-1 H:"hello, world\n" Z:0 A special variable called Z is often used in Subleq as an intermediate temporary variable within a highly small scope. It is commonly assumed that this variable is initialised at zero and left at zero after every usage. The program above consists of five instructions. First instruction prints the character pointed by its first operand (the first pointer) which is initialised to the beginning of the data string – the letter ’h’. Second instruction increments that pointer – the first operand of the first instruction. Third instruction increments the second pointer, which is the second operand of the fourth instruction. Fourth instruction tests the value pointed by the second pointer and halts the program when the value is zero. It becomes zero when the pointer reaches the cell one after the end of the data string, which is Z:0. The fifth instruction loops back to the beginning Come on. It's academic. You have to do a lot more to do everyday operations. Libraries/Demo Libraries for programs written in SUBLEQ assembly, as accepted by sqasm, are available. They provide several common functions: getint (read integer from input) gets (read string from input) putint (write integer to output) puts (write string to output) Several useful procedures are also available: bubblesort (sort a string of characters) calc (perform a given operation on two integers) factorial (calculate the factorial of a positive integer) primes (generate and print a list of primes) Usage information and equivalent C code (where appropriate) is provided in the comments of each of these files. A menu-driven program demonstrating the above libraries is also provided. Simply call make run in the project root directory to run the demo program. Interpreter A very minimal (only 222 bytes in size) SUBLEQ interpreter written in C is available: _____________ What everyday operations do you have in mind?
|
|
|
|
msin
Legendary
Offline
Activity: 1470
Merit: 1004
|
|
February 04, 2014, 11:38:23 PM |
|
In the meantime, I wish to report that 0.7.0 is running successfully with an H2 database backend, no more serialized java object files. No need to keep all blocks and transactions in memory anymore.
Magic! nice work. No, computer science. I'm starting to like ChuckOne.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:40:15 PM |
|
CfB, what is your opinion of subleq? It seems we just need to implement one opcode.
There already exists Higher_subleq (assembly language) and C compiler, so that sure sounds like the quickest path. The CPU model they use doesn't seem too crazy.
James
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 04, 2014, 11:42:44 PM |
|
Below is a "Hello world" program adapted from Lawrence Woodman helloworld.sq [10]. It is exceptionally terse, but is a good example of Subleq efficiency. L:H (-1); U L; U ?+2; Z H (-1); Z Z L . U:-1 H:"hello, world\n" Z:0 A special variable called Z is often used in Subleq as an intermediate temporary variable within a highly small scope. It is commonly assumed that this variable is initialised at zero and left at zero after every usage. The program above consists of five instructions. First instruction prints the character pointed by its first operand (the first pointer) which is initialised to the beginning of the data string – the letter ’h’. Second instruction increments that pointer – the first operand of the first instruction. Third instruction increments the second pointer, which is the second operand of the fourth instruction. Fourth instruction tests the value pointed by the second pointer and halts the program when the value is zero. It becomes zero when the pointer reaches the cell one after the end of the data string, which is Z:0. The fifth instruction loops back to the beginning Come on. It's academic. You have to do a lot more to do everyday operations. Check out http://da.vidr.cc/projects/subleq/Is it really just academic theoretical? They explain how they made C compiler in PDF, there is a chip that implements this I only know about this from when I found it, and not sure if it is usable, but if there is a C compiler for it, then it sure sounds usable to me. http://esolangs.org/wiki/Higher_Subleqhere is source to C compiler: http://mazonka.com/subleq/hsq.cppJames That's the point in being turing complete, right? turing-complete = you can calculate whatever is computable. So, C is turing complete and subleq is turing complete. That is, they are equivalent: there is a C program for every subleq program that delivers the very same output for the very same input and vice-versa. But anyway, I would always go with proven technology. I mean C and subleq are just ideas/standards/concepts. There are many, many compilers/programs/bits'n'bytes for them. There is where the problem occurs not on the paper but in the source code. There are the bugs and optimization potentials. Therefore: use what's already there and has been proven itself in millions of devices for years.
|
|
|
|
VanBreuk
|
|
February 04, 2014, 11:43:14 PM |
|
Great job everyone, these last few pages of juicy dev talk are giving me the first nxt hard-on this february.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:46:36 PM |
|
Below is a "Hello world" program adapted from Lawrence Woodman helloworld.sq [10]. It is exceptionally terse, but is a good example of Subleq efficiency. L:H (-1); U L; U ?+2; Z H (-1); Z Z L . U:-1 H:"hello, world\n" Z:0 A special variable called Z is often used in Subleq as an intermediate temporary variable within a highly small scope. It is commonly assumed that this variable is initialised at zero and left at zero after every usage. The program above consists of five instructions. First instruction prints the character pointed by its first operand (the first pointer) which is initialised to the beginning of the data string – the letter ’h’. Second instruction increments that pointer – the first operand of the first instruction. Third instruction increments the second pointer, which is the second operand of the fourth instruction. Fourth instruction tests the value pointed by the second pointer and halts the program when the value is zero. It becomes zero when the pointer reaches the cell one after the end of the data string, which is Z:0. The fifth instruction loops back to the beginning Come on. It's academic. You have to do a lot more to do everyday operations. Check out http://da.vidr.cc/projects/subleq/Is it really just academic theoretical? They explain how they made C compiler in PDF, there is a chip that implements this I only know about this from when I found it, and not sure if it is usable, but if there is a C compiler for it, then it sure sounds usable to me. http://esolangs.org/wiki/Higher_Subleqhere is source to C compiler: http://mazonka.com/subleq/hsq.cppJames That's the point in being turing complete, right? turing-complete = you can calculate whatever is computable. So, C is turing complete and subleq is turing complete. That is, they are equivalent: there is a C program for every subleq program that delivers the very same output for the very same input and vice-versa. But anyway, I would always go with proven technology. I mean C and subleq are just ideas/standards/concepts. There are many, many compilers/programs/bits'n'bytes for them. There is where the problem occurs not on the paper but in the source code. There are the bugs and optimization potentials. Therefore: use what's already there and has been proven itself in millions of devices for years. You are confusing me. Are you agreeing with me or saying that somehow subleq is pure academics and not proven. I found open source C compiler with example programs all that generate subleq, a single opcode for every instruction. If there is a C compiler, we can use all the existing C code out there as long as we honor VM limitations. So, please explain why C compiler -> higher_subleq -> subleq is useless academic and not a practical solution. You have to remember I have been proven to be incompetent in technical stuff so I need to have things explained to me, even if it is obvious to the smart guys James
|
|
|
|
Mistafreeze
|
|
February 04, 2014, 11:47:37 PM |
|
Anybody here from NxtCrypto.org have an issue with me using a cropped version of the Nxt on fire within my installer as seen below? I'm trying to spice it up a bit.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:48:36 PM |
|
Anybody here from NxtCrypto.org have an issue with me using a cropped version of the Nxt on fire within my installer as seen below? I'm trying to spice it up a bit. If that was BTC, it would be perfect for XCP logo, but for NXT it looks like you are burning NXT. Not sure it is so good.
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 04, 2014, 11:50:14 PM |
|
Libraries/Demo
Libraries for programs written in SUBLEQ assembly, as accepted by sqasm, are available.
They provide several common functions:
getint (read integer from input) gets (read string from input) putint (write integer to output) puts (write string to output)
Several useful procedures are also available:
bubblesort (sort a string of characters) calc (perform a given operation on two integers) factorial (calculate the factorial of a positive integer) primes (generate and print a list of primes) Usage information and equivalent C code (where appropriate) is provided in the comments of each of these files.
A menu-driven program demonstrating the above libraries is also provided. Simply call make run in the project root directory to run the demo program.
Interpreter A very minimal (only 222 bytes in size) SUBLEQ interpreter written in C is available: _____________
What everyday operations do you have in mind?
You really like it, right? It's okay. Nevermind. It's just that I trust technology like that only after many years of production. That's all. It's not that I do not think they weren't capable of producing a good piece of compiler and libs. It's just that: nobody's perfect, especially no programmers. In the end, only time can 'prove' correctness.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:58:07 PM |
|
Libraries/Demo
Libraries for programs written in SUBLEQ assembly, as accepted by sqasm, are available.
They provide several common functions:
getint (read integer from input) gets (read string from input) putint (write integer to output) puts (write string to output)
Several useful procedures are also available:
bubblesort (sort a string of characters) calc (perform a given operation on two integers) factorial (calculate the factorial of a positive integer) primes (generate and print a list of primes) Usage information and equivalent C code (where appropriate) is provided in the comments of each of these files.
A menu-driven program demonstrating the above libraries is also provided. Simply call make run in the project root directory to run the demo program.
Interpreter A very minimal (only 222 bytes in size) SUBLEQ interpreter written in C is available: _____________
What everyday operations do you have in mind?
You really like it, right? It's okay. Nevermind. It's just that I trust technology like that only after many years of production. That's all. It's not that I do not think they weren't capable of producing a good piece of compiler and libs. It's just that: nobody's perfect, especially no programmers. In the end, only time can 'prove' correctness. Well if we can use proven solution, then we wouldnt have to develop our own. Do you want to wait until etherium is proven and then use that? I am confused again. I think we can have a path to Turing complete script with C compiler and a small amount of functions. The alternative is to implement 28 or 32 opcodes, which is a lot more work as each opcode needs to be implemented and tested, etc. If CfB signs off on subleq VM, then we can start in parallel fleshing out and TESTING more and more C libraries based on subleq C compiler. I like being able to develop a project in separate pieces. As soon as we have subleq scripting, we can then hook up all the higher level stuff that has been ported and tested. Does that make sense? Anon, Alias, CIYAM, other smart guys. Please tell me if I am being incompetent again, or did I get lucky? James P.S. If CfB signs off on subleq VM, I will authorize bounties for getting the higher level functions done. It is clear to me that we need a layer of code that abstracts the details of script, AM, etc and allows higher level development. With a C compiler available, maybe one of the bounties will be to port a higher level language to subleq VM
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 04, 2014, 11:59:53 PM |
|
CfB?
Abandon subleq or push forward?
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 05, 2014, 12:00:51 AM |
|
So, please explain why C compiler -> higher_subleq -> subleq is useless academic and not a practical solution. You have to remember I have been proven to be incompetent in technical stuff so I need to have things explained to me, even if it is obvious to the smart guys
James
Hmmm. Where to start with? 1) Yes, it could be done with it. Why, because both languages are turing complete. (That's the stuff on the paper, proven with formulas etc.) 2) Yes, it could be practical. But, the bugs are not on the paper and not in the formulas. But in the source code of the compilers and the VM AND their respective compilers. It's not the mathematical proof that's wrong, it's just that programmers make mistakes as human usually do. 3) So, use proven technologies in the sense that time has proven them to be reliable. Not proven in the sense of formulas. It's more like robust or bulletproof code for VM and compilers. Less bugs, more support, because more people are using them right now. What if the subleq developers discontinue development? And so on. But anyway, yes. You won the contest. 1 Op-Code is cool.
|
|
|
|
swartzfeger
|
|
February 05, 2014, 12:01:42 AM |
|
Great job everyone, these last few pages of juicy dev talk are giving me the first nxt hard-on this february.
Yup, better than the usual 'the sky is falling' bullshit. Anybody here from NxtCrypto.org have an issue with me using a cropped version of the Nxt on fire within my installer as seen below? I'm trying to spice it up a bit. If that was BTC, it would be perfect for XCP logo, but for NXT it looks like you are burning NXT. Not sure it is so good. At first I thought 'wow, looks cool!' Then considered what James said... seeing something on fire may not be the best image when installing software. I'm probably over-thinking this. Looks cool. Maybe a bit over the top. Nice to see an install screen spiced up, though.
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 05, 2014, 12:03:37 AM |
|
Libraries/Demo
Libraries for programs written in SUBLEQ assembly, as accepted by sqasm, are available.
They provide several common functions:
getint (read integer from input) gets (read string from input) putint (write integer to output) puts (write string to output)
Several useful procedures are also available:
bubblesort (sort a string of characters) calc (perform a given operation on two integers) factorial (calculate the factorial of a positive integer) primes (generate and print a list of primes) Usage information and equivalent C code (where appropriate) is provided in the comments of each of these files.
A menu-driven program demonstrating the above libraries is also provided. Simply call make run in the project root directory to run the demo program.
Interpreter A very minimal (only 222 bytes in size) SUBLEQ interpreter written in C is available: _____________
What everyday operations do you have in mind?
You really like it, right? It's okay. Nevermind. It's just that I trust technology like that only after many years of production. That's all. It's not that I do not think they weren't capable of producing a good piece of compiler and libs. It's just that: nobody's perfect, especially no programmers. In the end, only time can 'prove' correctness. Well if we can use proven solution, then we wouldnt have to develop our own. Do you want to wait until etherium is proven and then use that? I am confused again. I think we can have a path to Turing complete script with C compiler and a small amount of functions. The alternative is to implement 28 or 32 opcodes, which is a lot more work as each opcode needs to be implemented and tested, etc. If CfB signs off on subleq VM, then we can start in parallel fleshing out and TESTING more and more C libraries based on subleq C compiler. I like being able to develop a project in separate pieces. As soon as we have subleq scripting, we can then hook up all the higher level stuff that has been ported and tested. Does that make sense? Anon, Alias, CIYAM, other smart guys. Please tell me if I am being incompetent again, or did I get lucky? James P.S. If CfB signs off on subleq VM, I will authorize bounties for getting the higher level functions done. It is clear to me that we need a layer of code that abstracts the details of script, AM, etc and allows higher level development. With a C compiler available, maybe one of the bounties will be to port a higher level language to subleq VM Ah yes. And if you have to pay per op, then you will get poor when using subleq. It's really more expensive.
|
|
|
|
Jean-Luc
|
|
February 05, 2014, 12:03:59 AM |
|
Yes. I haven't made any changes to the javascript client. What are the plans for the web client in future? Will be developed further on or will be removed from the distribution?
Will not be developed, will be removed only after a complete replacement client is available, web based or not.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 05, 2014, 12:05:24 AM |
|
So, please explain why C compiler -> higher_subleq -> subleq is useless academic and not a practical solution. You have to remember I have been proven to be incompetent in technical stuff so I need to have things explained to me, even if it is obvious to the smart guys
James
Hmmm. Where to start with? 1) Yes, it could be done with it. Why, because both languages are turing complete. (That's the stuff on the paper, proven with formulas etc.) 2) Yes, it could be practical. But, the bugs are not on the paper and not in the formulas. But in the source code of the compilers and the VM AND their respective compilers. It's not the mathematical proof that's wrong, it's just that programmers make mistakes as human usually do. 3) So, use proven technologies in the sense that time has proven them to be reliable. Not proven in the sense of formulas. It's more like robust or bulletproof code for VM and compilers. Less bugs, more support, because more people are using them right now. What if the subleq developers discontinue development? And so on. But anyway, yes. You won the contest. 1 Op-Code is cool. Hey, as cool as one opcode is I much prefer to use 28 or 32 or whatever if it gives us a better starting point as far as fully debugged libraries, etc. goes. The less work we have to do to be able to construct useful solutions, the better. That is my metric. Does anybody know of any open source C compiler for the 28 opcode language? Libraries? If I have to choose between subleq and another unproven simple machine language ecosystem, I would choose subleq just because is to kind of cool with one opcode. But only if it is at the equivalent state. So, please anybody know of simplified machine language with open source C compiler and lots and lots of library code and projects verified on it? James
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
February 05, 2014, 12:07:14 AM |
|
Libraries/Demo
Libraries for programs written in SUBLEQ assembly, as accepted by sqasm, are available.
They provide several common functions:
getint (read integer from input) gets (read string from input) putint (write integer to output) puts (write string to output)
Several useful procedures are also available:
bubblesort (sort a string of characters) calc (perform a given operation on two integers) factorial (calculate the factorial of a positive integer) primes (generate and print a list of primes) Usage information and equivalent C code (where appropriate) is provided in the comments of each of these files.
A menu-driven program demonstrating the above libraries is also provided. Simply call make run in the project root directory to run the demo program.
Interpreter A very minimal (only 222 bytes in size) SUBLEQ interpreter written in C is available: _____________
What everyday operations do you have in mind?
You really like it, right? It's okay. Nevermind. It's just that I trust technology like that only after many years of production. That's all. It's not that I do not think they weren't capable of producing a good piece of compiler and libs. It's just that: nobody's perfect, especially no programmers. In the end, only time can 'prove' correctness. Well if we can use proven solution, then we wouldnt have to develop our own. Do you want to wait until etherium is proven and then use that? I am confused again. I think we can have a path to Turing complete script with C compiler and a small amount of functions. The alternative is to implement 28 or 32 opcodes, which is a lot more work as each opcode needs to be implemented and tested, etc. If CfB signs off on subleq VM, then we can start in parallel fleshing out and TESTING more and more C libraries based on subleq C compiler. I like being able to develop a project in separate pieces. As soon as we have subleq scripting, we can then hook up all the higher level stuff that has been ported and tested. Does that make sense? Anon, Alias, CIYAM, other smart guys. Please tell me if I am being incompetent again, or did I get lucky? James P.S. If CfB signs off on subleq VM, I will authorize bounties for getting the higher level functions done. It is clear to me that we need a layer of code that abstracts the details of script, AM, etc and allows higher level development. With a C compiler available, maybe one of the bounties will be to port a higher level language to subleq VM Ah yes. And if you have to pay per op, then you will get poor when using subleq. It's really more expensive. Hmmm. maximizes transaction fees, unfortunate isn't it. I imagine much lower min fee would be needed as soon as we launch Turing complete scripts
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 05, 2014, 12:08:06 AM |
|
So, please explain why C compiler -> higher_subleq -> subleq is useless academic and not a practical solution. You have to remember I have been proven to be incompetent in technical stuff so I need to have things explained to me, even if it is obvious to the smart guys
James
Hmmm. Where to start with? 1) Yes, it could be done with it. Why, because both languages are turing complete. (That's the stuff on the paper, proven with formulas etc.) 2) Yes, it could be practical. But, the bugs are not on the paper and not in the formulas. But in the source code of the compilers and the VM AND their respective compilers. It's not the mathematical proof that's wrong, it's just that programmers make mistakes as human usually do. 3) So, use proven technologies in the sense that time has proven them to be reliable. Not proven in the sense of formulas. It's more like robust or bulletproof code for VM and compilers. Less bugs, more support, because more people are using them right now. What if the subleq developers discontinue development? And so on. But anyway, yes. You won the contest. 1 Op-Code is cool. Hey, as cool as one opcode is I much prefer to use 28 or 32 or whatever if it gives us a better starting point as far as fully debugged libraries, etc. goes. The less work we have to do to be able to construct useful solutions, the better. That is my metric. Does anybody know of any open source C compiler for the 28 opcode language? Libraries? If I have to choose between subleq and another unproven simple machine language ecosystem, I would choose subleq just because is to kind of cool with one opcode. But only if it is at the equivalent state. So, please anybody know of simplified machine language with open source C compiler and lots and lots of library code and projects verified on it? James ARM-RISC, there is. Compilers and VMs en masse. VM for ARM-RISC.... have to research that. But's time to catch some sleep.
|
|
|
|
dzarmush
Legendary
Offline
Activity: 1806
Merit: 1001
|
|
February 05, 2014, 12:10:28 AM |
|
Looks like Nxt going to hell.
|
|
|
|
ChuckOne
Sr. Member
Offline
Activity: 364
Merit: 250
☕ NXT-4BTE-8Y4K-CDS2-6TB82
|
|
February 05, 2014, 12:10:35 AM |
|
Ah yes. And if you have to pay per op, then you will get poor when using subleq. It's really more expensive. Hmmm. maximizes transaction fees, unfortunate isn't it. I imagine much lower min fee would be needed as soon as we launch Turing complete scripts Yes, we would to. That's what you buy if you have only one op-code. That's also the reason why we have high-level languages. No code duplication = better maintainability is the goal.
|
|
|
|
|