Author Topic: Programming Megathread  (Read 106510 times)


i'm bored so i'm making a scripting language out of java just for the heck of it. i only have like 2 weeks of experience in java and no experience with making anything good that isn't in torquescript so maybe if any of you are feeling generous could look over what i have so far and tell me how i forgeted up

i got real basic stuff set up right now like creating global variables and doing arithmetic. the math right now follows order of operations but can't do parenthesizes yet because i haven't thought of a way to do those

https://github.com/bansheerubber/script

i'm bored so i'm making a scripting language out of java just for the heck of it. i only have like 2 weeks of experience in java and no experience with making anything good that isn't in torquescript so maybe if any of you are feeling generous could look over what i have so far and tell me how i forgeted up

i got real basic stuff set up right now like creating global variables and doing arithmetic. the math right now follows order of operations but can't do parenthesizes yet because i haven't thought of a way to do those

https://github.com/bansheerubber/script

can you show me an example of a script?


can you show me an example of a script?
right now you can't script its just declaring variables
the only thing that works right now is stuff like this:
int test1 = 50
int test2 = 100 + 1 * 3 / 2
int test3 = test1 + test2

notably you have a power operator and i know ^ is usually reserved for something else like xor but i don't care
int test4 = 2 ^ 4

i'm hoping to get this working into a full fledged scripting language. i'm not worrying about speed or anything else, i just want to see if i can make a scripting language. the rest of the syntax will probably be sort of like python/lua in that you indent instead of using {}'s because i like that sort of syntax better
« Last Edit: August 30, 2017, 04:48:38 PM by Gytyyhgfffff »

i took ap compsci online once and had to learn everything about java, and that stuff took like 7 months. yet you have 2 weeks experience and your code is like, 100x better thanmine

i took ap compsci online once and had to learn everything about java, and that stuff took like 7 months. yet you have 2 weeks experience and your code is like, 100x better thanmine

Once you've been programming for a while it's not hard to pick up other languages (with the help of google). That's probably the case here.




notably you have a power operator and i know ^ is usually reserved for something else like xor but i don't care
int test4 = 2 ^ 4
why not use the more typical **, or just leave it to a function

why not use the more typical **, or just leave it to a function
i didn't think of the ** thing and i didn't want to have it as a function because that stuff takes about 50 years to type out compared to the 1 nanosecond it takes to type something like ^ or **

i didn't think of the ** thing and i didn't want to have it as a function because that stuff takes about 50 years to type out compared to the 1 nanosecond it takes to type something like ^ or **
I meannn. Yes? But do you anticipate doing power operations ~that~ much? 'cause I can tell you I barely use them and when I do I might as well be typing out pow(b, x)...

Also have you looked into the process of actually creating compilers and stuff rather than evaluating the language entirely in Java? I know it's a lot more work but honestly it's a lot more useful in terms of learning and might require a lot more background knowledge but it's a really rewarding process. I'm in a class that helps build that knowledge right now so if you ever wanted to talk about it I'd be down to talk, but we're gonna be making a compiler for the language "COOL" (click) and we've already made an interpreter for a stack machine (click) which is a good introduction to the process.

i payed 50 dollars for a massive book on javascript

im instead studying torquescript and learning off of addons made by the community

torquescript is basically bootleg js so that book mightve come in handy