A bit of work but after seeing @fuzzyastrocat‘s (who this title belongs to) Python interpreter in C I decided to make my own! One conundrum I cannot program in C so why not use Javascript!
Presenting Python in Javascript!
Pretty basic interpreter, but I assure you’ll have indentation errors for days! I decided to implement basic Python features such as:
- functions
- print()
- logic (if/else)
- operations
- “good readability (aka whitespace for daysss)”
So try it by messing around in the .pyjs
file! Also if you want to see the tree breaking down your file switch the _debug
variable to true! Happy coding!
nice!
(also did you see my cries for help)
school forcing me to do this thing where you help ppl, so I convinced them to let me make a website for someone. Now I'm stuck since I'm horrible at frontend
@realTronsi ahh I see. Okay I’ll help.
@RayhanADev I'll send you an invite and we can chat there
@RayhanADev ok lmk when you're free today :D
@realTronsi wanna work?
@RayhanADev oh hey, sorry for the late response ut sure
@RayhanADev im back
Nice!
Idea: rather than being run in JS, transpile (translate) the Python code into JS code. That way Python could run "natively" on the web!
@fuzzyastrocat I actually only got the idea about that when you mentioned it earlier today hehe I’ll work on it!
@fuzzyastrocat yo how did you just jump from 800 cycles to 1200 cool
@HahaYes Python in C + Remains of askew 2nd update + Real 3D + Build your own language in C = +400 cycles
@fuzzyastrocat 2 among us console in python = +500 cycles
@RayhanADev My cycles strategy: spam high-quality, high-effort posts in as much quantity as possible.
That way I can barely keep up with the people who post one or two low-quality posts which relate to a trendy item.
@fuzzyastrocat My cycles strategy:
1. Make good project
2. Post to share
3. Watch it get 10 upvotes and die
4. Get a bag of gummy bears, pay my brother a dollar (bet we have that I’m losing) and make something else
@RayhanADev You mean you don't use developer tools to trick your brother into thinking your posts have 500 upvotes? :D
@fuzzyastrocat dude my older brother is one of the smartest people I know. I can’t fool him if I tried my hardest (I tried!)
@RayhanADev
> hack into repl.it
> literally change the number of upvotes on your post
> genius
@fuzzyastrocat ah yes, now can you teach me about Repl.it’s rest api xd.
@fuzzyastrocat lol gg
@RayhanADev sometime i wll make somethin for .py to .cpp
in C++
lol
@fuzzyastrocat how do you not have your post in a blockquote lel
@Stan085 nice! Good luck!
@Stan085 \>
doesn't make it a blockquote, just shows it as a literal >
.
Nice job! Mine is the opposite of yours, I created JavaScript in Python! https://repl.it/@Elderosa/JS-in-Python#main.py
Nice!
(not trying to advertise, but a made a Lua Interpreter in JavaScript here)
Wow, this is pretty sick!
@MarcusWeinberger thanks my dude! (ˊᗜˋ)/ᵗᑋᵃᐢᵏ ᵞᵒᵘ*
I cannot program in C
so you should learn how to program in C.
@programmeruser i know, I’m just too attached to JS. But I have decided that over Christmas breakI will be learning C.
@RayhanADev if you do want to learn C try https://learn-c.org. Learning C++ after that isn't too hard.
hi rayhan please help, ren shoulve invited you 🥺🥺🥺🥺🥺🥺
@TsunamiOrSumth lmao omfg 999 cycles xD. I’m screenshotting.
@TsunamiOrSumth also me no get invite
@RayhanADev gg 1000
@TsunamiOrSumth HAHHAHAHAHAHAHA 1000 GG THANK YOU hAA
@RayhanADev input()
and eval()
no work big sad :(
@CoolGuy27 lmao big sad :(
it took me quite a while to get here actually and input would be ridiculous to add xD
@RayhanADev lol i get that you did a great job with everything you added. i could only do NOTHING
@CoolGuy27 hahaha rip yeah. I’ll work on and try to add me (actually I wanna try and make it transpile so Python for the Web)
@RayhanADev that would be genius!
@CoolGuy27 credit to fuzzy, I’m working on it!
I'm starting to miss the dancing shiny furret...
@ThisUserTaken hahahhahahhahahhahahahah. Well look at @HelperFurret and make yourself feel better!
I made my own version of python in python heehee
@jort57 smh and I made my own too:
code = input(“> “)
exec(code)
@jort57 try to make a python shell inside of the python shell you made
@RayhanADev How about making a new version of python in python
:O
@Hamburgr and then make a new version of python using your old new version of python
@Hamburgr its pyception
get on repl dash i have a question to ask you :)
How do yall even make this I would like to request a tutorial in C, C++, or Python.
@jort57 sorry can’t help you because I don’t know the C family and despise Python but I can give a decent tutorial on NodeJS (which I used in this)
@RayhanADev ok sure i know nothing about js
@jort57 also python is best
@elipie thank for tutorial, but whats the point of the language if it doesnt execute anything? :/
@jort57 what why is it duplicate wth
@jort57 tutorial you say?
@jort57 That tutorial is my tutorial. The reason it doesn't execute anything yet is because that's part 1 of 2, if you read the title or the ending (where it clearly says "next time, we'll implement execution"). The second part isn't out yet, this stuff takes time which I often don't have.
@fuzzyastrocat oh i see. sorry bout that.
@jort57 Nothing to be sorry about, just clearing things up :D
Very cool!
Interpreted in interpreted
shuddersHmm, next all you gotta do is make JS in python! (jk)
@elipie hahahahha I can’t do any worse than that can I lmao.
@RayhanADev lmao.
Or make js in this version of python made in [email protected]
@hg0428 actually I can’t because it doesn’t have everything
If you add what you need to it then you [email protected]
@hg0428 yessir!
@RayhanADev It has functions... if they're a first class citizen as in python then yes, you can actually do it. Now, that might require the input to be in the form of a crazy function expression, but it is possible since first-class functions are turing-complete alone.
@RayhanADev
yeah, rlly, not evenopen()