? I'm creating a online SmileBasic interpeter (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

I'm creating a online SmileBasic interpeter

  • #1 ✎ 15 Ertas Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself sorry if this topic doesnt fit here but what im doing is create a SmileBasic interpeter, its like with the touchscreen command shortcuts and the direct mode and edit mode are supported (including slot 1 2 3) i dont know how long its gonna take but if you want to help create the interpeter, DM me to collaborate PS: the website is https://smilebasic.glitch.me/ Posted Edited by Ertas
  • #2 ✎ 264 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength How far have you gotten? Posted
  • #3 ✎ 110 CyberYoshi64 Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Forum Contributor Hidden Achievements
    How far have you gotten?
    ..., grab some coffee and relax.
    Posted Edited by CyberYoshi64
  • #4 ✎ 15 Ertas Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    How far have you gotten?
    How far have you gotten?
    ..., grab some coffee and relax.
    1st, i currently only have print, acls and option. 2nd, i put grab some coffee and relax because i was bored
    Posted
  • #5 ✎ 86 Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies I would be happy to help Instead of making it an interpreter, since you chose JavaScript, you can make it a compiler since it supports reflection (the exec() function). This would make it run soo much faster. Faster than the original SmileBASIC. I don't know your JavaScript programming experience, but the easiest way to make a 'compiler' would be to have a Regular Expression with capturing groups to replace each line with its appropriate JavaScript syntax. An example FOR loop conversion to JavaScript: code.replace( /FOR +([a-z]+) *= *([a-z0-9]+) +TO +([a-z0-9]+)( +STEP +([a-z0-9]+))? +/gi, "for(var $1=$2;$1<$3;$1+=1||$5) {" ) The issue you will run into is the fact that JavaScript forces a structured WAIT/VSYNC, using SetTimeout(). SmileBASIC does not do this. There are workarounds in JavaScript called promises, which allow unstructured non-async sleep. It gets a bit advanced. When you have a fully converted program its easy since all you need to do is type exec(code) in JavaScript. Well, I'm here to help if you need meI did a similar project in the past http://s1meon.art/project/BASIC-Programming.html This converts a different flavor of BASIC into JavaScript. It may be useful to you Posted Edited by Simeon
  • #6 ✎ 1550 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website That won't work Posted
  • #7 ✎ 15 Ertas Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    I would be happy to help Instead of making it an interpreter, since you chose JavaScript, you can make it a compiler since it supports reflection (the exec() function). This would make it run soo much faster. Faster than the original SmileBASIC. I don't know your JavaScript programming experience, but the easiest way to make a 'compiler' would be to have a Regular Expression with capturing groups to replace each line with its appropriate JavaScript syntax. An example FOR loop conversion to JavaScript: code.replace( /FOR +([a-z]+) *= *([a-z0-9]+) +TO +([a-z0-9]+)( +STEP +([a-z0-9]+))? +/gi, "for(var $1=$2;$1<$3;$1+=1||$5) {" ) The issue you will run into is the fact that JavaScript forces a structured WAIT/VSYNC, using SetTimeout(). SmileBASIC does not do this. There are workarounds in JavaScript called promises, which allow unstructured non-async sleep. It gets a bit advanced. When you have a fully converted program its easy since all you need to do is type exec(code) in JavaScript. Well, I'm here to help if you need meI did a similar project in the past http://s1meon.art/project/BASIC-Programming.html This converts a different flavor of BASIC into JavaScript. It may be useful to you
    oh thanks for trying to help me! but check your DM's ill give a link to the project
    Posted
  • #8 ✎ 60 seggiepants You may want to team up with 12ME21's 12-BASIC http://smilebasicsource.com/forum?fpid=21721. Last I looked I was rather impressed. I will reiterate my suggestions here. Compiler/Interpreter development is non-trivial, and requires careful planning. It is not something you start because you are bored or for the lulz. You would be better off learning a new language such as Javascript or adopting an existing Basic compiler like say QB64 http://www.qb64.net a QBasic/QuickBasic work alike. If you want to make one still I suggest research. The Dragon book is very much a University level book, and is somewhat outdated it seems. https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811# I have seen recommendations online for: Modern Compiler Implementation in Java https://www.amazon.com/Modern-Compiler-Implementation-Andrew-Appel/dp/052182060X/ref=mp_s_a_1_1?ie=UTF8&qid=1530553448&sr=8-1&pi=AC_SX236_SY340_QL65&keywords=modern+compiler+implementation+in+java+second+edition&dpPl=1&dpID=41RIxhpvQ9L&ref=plSrch and Engineering: a Compiler https://www.amazon.com/gp/aw/d/012088478X/ref=pd_aw_fbt_14_img_3?ie=UTF8&psc=1&refRID=HF7YZYX9AM8SW2GBFJFR I also highly recommend using some compiler making tools like LLVM, ANTLR, YACC/Bison, LEX/FLEX. I expect some BNF from a compiler/interpreter project. Do you have any? I don't think ad hoc efforts will scale. Something like this needs engineering. Maybe try something like a math expression evaluator instead of a full programming language for your first interpreter. The following link has some BNF examples. https://rosettacode.org/wiki/BNF_Grammar Posted Edited by seggiepants
  • #9 ✎ 15 Ertas Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    You may want to team up with 12ME21's 12-BASIC http://smilebasicsource.com/forum?fpid=21721. Last I looked I was rather impressed. I will reiterate my suggestions here. Compiler/Interpreter development is non-trivial, and requires careful planning. It is not something you start because you are bored or for the lulz. You would be better off learning a new language such as Javascript or adopting an existing Basic compiler like say QB64 http://www.qb64.net a QBasic/QuickBasic work alike. If you want to make one still I suggest research. The Dragon book is very much a University level book, and is somewhat outdated it seems. https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811# I have seen recommendations online for: Modern Compiler Implementation in Java https://www.amazon.com/Modern-Compiler-Implementation-Andrew-Appel/dp/052182060X/ref=mp_s_a_1_1?ie=UTF8&qid=1530553448&sr=8-1&pi=AC_SX236_SY340_QL65&keywords=modern+compiler+implementation+in+java+second+edition&dpPl=1&dpID=41RIxhpvQ9L&ref=plSrch and Engineering: a Compiler https://www.amazon.com/gp/aw/d/012088478X/ref=pd_aw_fbt_14_img_3?ie=UTF8&psc=1&refRID=HF7YZYX9AM8SW2GBFJFR I also highly recommend using some compiler making tools like LLVM, ANTLR, YACC/Bison, LEX/FLEX. I expect some BNF from a compiler/interpreter project. Do you have any? I don't think ad hoc efforts will scale. Something like this needs engineering. Maybe try something like a math expression evaluator instead of a full programming language for your first interpreter. The following link has some BNF examples. https://rosettacode.org/wiki/BNF_Grammar
    i dont plan on making a compiler yet but its informative i guess also important: theres only 2 days until summer vacation, i dont have time until school ends, so i cant work now but later i can
    Posted
  • #10 ✎ 60 seggiepants Compilers and interpreters aren't all that different. One writes out code from an abstract syntax tree, the other translates it into actions. Considering Java, .Net, and Python all build something to an intermediate code step things get fuzzier still. Anyway have a fun summer vacation, and good luck on the project. Posted