Skip to content
Sign upLog in
← Back to Community

JavaScript Interpreter From Scratch! πŸ”₯

Profile icon
CSharpIsGud

This has been sitting in my repls for months, but with repls new addition of Nix, I can finally start working with it again.
This is a prelude to the browser engine I am creating. I don't mean just starting up python and running chromium with it. I have an HTML parser, a CSS parser, and this all done from scratch. I've been waiting for repl to add an apt alternative forever so that I could use an actual gui library and it's finally been added!

This has most of the basic features of JS, but I'm sure it has some quirks. I'm also sure the errors are really bad and uninformative.
But it does work. It supports JSON, and the JSON parsing and stringifying code was all made in js, instead of cheating and using C++.

Voters
Profile icon
MartiaForoud
Profile icon
thelonecodist
Profile icon
AmyTheCutie
Profile icon
Highwayman
Profile icon
InvisibleOne
Profile icon
nadir92
Profile icon
Loshad
Profile icon
Streamz
Profile icon
JakeSmith21
Profile icon
AashayBongulwar
Comments
hotnewtop
Profile icon
[deleted]

scratch is not a programming language bro

Profile icon
CSharpIsGud

@adilskillz
No it very much is not. But it is a word in the dictionary

Profile icon
LukeWright

lmao

@CSharpIsGud

Profile icon
ch1ck3n

@adilskillz
LMAOOO

Profile icon
[deleted]

@CSharpIsGud
i was joking lol

Profile icon
PyCoder01

@adilskillz
LMFAO

Profile icon
PixiGem

@adilskillz
its coding language for kids...
https://scratch.mit.edu/projects/editor/?tutorial=getStarted

Profile icon
[deleted]

i know i am thats why i said scrtch is not real [email protected]

Profile icon
AmazingMech2418

@adilskillz
Well, it technically is on the TIOBE index!

image

Profile icon
[deleted]

o wow

@AmazingMech2418

Profile icon
PikachuB2005

@PixiGem
@griffpatch
,
@scratch-minion
... should I go on?

Profile icon
[deleted]

@adilskillz
Scratch is more of a "programming language" for little kids developed the Massachusetts Institute of Technology (MIT). NOT JUST FOR LITTLE KIDS, Scratch is a part of their curriculum.

Profile icon
KarmaIsADick

If it let you see your code in whatever programming they use (probably Java) then I would use it because it would be a lot easier than writing it all out, I could just drag and drop!

@SirLemons

Profile icon
potatojs

@adilskillz
it is a programming language, a visual one; no matter who use it the fact that it is a programming language won't change.

Profile icon
KidOfCode

@SirLemons
Scratch is more of a "programming language" for little kids ROTFLMAO

Profile icon
[deleted]

@KidOfCode
its block code. not a programming language
i believe

Profile icon
KidOfCode

@devbois
ik

Profile icon
KidOfCode

i have done scratch before and its, meh, i did it with friends for [email protected]

Profile icon
ShasvatTheCoder

@SirLemons
Yes, I Agree

Profile icon
CodinUser

@adilskillz
its just an GUI for making little sites

Profile icon
conspicous

@CSharpIsGud
Heyo, to be honest i felt kinda sad when you left this project behind, Just remember i am available to help out someone (UI designs and that since i've gotten pretty good - not perfect tho)

Are we still going to use OpenGL as it is very resource intensive?

Hope you're well :D

Profile icon
CSharpIsGud

@StringentDev
Nah thats why I left it behind since opengl isn't good for a gui. Now an actual gui library can be used with nix.

Profile icon
conspicous

@CSharpIsGud
opengl is not really good for a lot of things, Chrome will not use it as its ANGLE renderer as it has increased performace but extreme power consumption.

Also i just realised it is not on the team lol (Amasad added publishing for teams.)

Profile icon
DynamicSquid

This is a prelude to the browser engine

Can't wait to see that! So you have all the parsers, you just have to translate that into GUI elements, and then you'd be done?

Also is it on GitHub?

Profile icon
CSharpIsGud

@DynamicSquid
I might put it on github once it's working at the very least.
Theres a lot of stuff in HTML and css that define where things go, like flexbox, margins and all that. Theres also display: block, position: relative vs fixed vs absolute vs etc and plus many years worth of js apis

Profile icon
matthewproskils

Oh the legend csharp is gud did it again

Profile icon
P0GCHAMPB0i

cool

Profile icon
RahulChoubey1

what's apt? and what's nix?

Profile icon
xxpertHacker

Will the CSS engine be embeddable? I was looking for a specification-compliant CSS parser embeddable into a C++ project a few months ago, but it didn't seem like Firefox's or Chromium's stuff was intended to be usable without the browser or a renderer.

Profile icon
CSharpIsGud

@xxpertHacker
rn all the separate projects are done in headers and are easy to just plug into anything but I cant say anything on it reaching full spec capacity soon

Profile icon
xxpertHacker

@CSharpIsGud
Ofc it's not going to be compliant yet. Just a fair warning: the standards can be complicated and hard to read, imho. You'll have to take from HTML, W3C, TC262, and a bunch of other groups if you're going to make a whole browser.
But I could probably spot incorrect results from the headers, and report issues Β―\_(ツ)_/Β―

Profile icon
[deleted]

@xxpertHacker
hi im not sure if I contacted u on this account or
@cutech
but shall we start working together again? Something about chromebooks?

Profile icon
xxpertHacker

@BooleanBean
You're a few months too late, sorry :/

Profile icon
[deleted]

@xxpertHacker
why lol

Profile icon
atupuxi

Can't wait to see that!

Profile icon
DungeonMaster00

i dare you to make a vivaldi browser clone from the engine

Profile icon
Whippingdot

vivaldi is good but edge canary is better ;) If you want the new features early then go for edge canary, cause you get updates every day. The most recent big update was the addition of GROUPS LIKE VIVALDI AAAAAAAAAAAAA
image


@DungeonMaster00

Profile icon
KarmaIsADick

I agree with you. My friend sitting next to me, though, despies all thing Microsoft.

@Whippingdot

Profile icon
DungeonMaster00

@Whippingdot
i am not an edge person sorry. i use firefox.

also, can you tile tabs in the canary version of edge? (i dont know, but the answer is probably no)

Profile icon
DungeonMaster00

@Whippingdot
also the update for that day might be unstable because they have little to no testing

Profile icon
Whippingdot

true, that is why dev version is more stable, but either is ok with me. Also no, edge does not have tiling tabs, but 100 % edge has more features than firefox. Vivaldi has more features than edge, but edge has a cleaner look, and implements the features better. Like you can minimize the vertical tabs bar in edge, but in vivaldi it is stuck, and you can only resize it

@DungeonMaster00

Profile icon
AmazingMech2418

I think I might want to make a browser engine too! Just wondering, did you use official JS standards or just things you already knew about the language? If the official standards, could you by any chance point me to where to find them? Also, just wondering, what GUI library are you planning on using?

Profile icon
fuzzyastrocat

@AmazingMech2418
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_Resources, namely this

Profile icon
DungeonMaster00

@AmazingMech2418
i might consider making an open source vivaldi browser clone from chromium. also, i dared csharpisgud to make a vivaldi browser clone out of their engine

Profile icon
AmazingMech2418

@DungeonMaster00
Nice! LOL!

@fuzzyastrocat
Thank you!

Profile icon
CSharpIsGud

@AmazingMech2418
I used just what I knew already, any weird things js has I'll just have to add later

Profile icon
RobbieBlizzard

nerd

Profile icon
grapecoder

@RobbieBlizzard
imagine saying that on repl. We are all smart here. I mean, maybe you're saying this to put someone down for being smarter than you? That's not funny and no one cares.

Profile icon
PyCoder01

@RobbieBlizzard
You're just jealous of him.

Profile icon
CSharpIsGud

@AnvayMathur1
oof did he edit his comment

Profile icon
darkdarcool

@RobbieBlizzard

Aren’t we all nerds? And why would you post that? No one cares about people being smart people here

Profile icon
grapecoder

@CSharpIsGud
No, this dude actually called someone a nerd in replit. We are all nerds.

Profile icon
CSharpIsGud

@darkdarcool
I don't see the insulting part of simply "nerd" everyone here is a nerd, so really this line of comments just shows how people on repl will defend first and evaluate the meaning later

Profile icon
darkdarcool

@CSharpIsGud
yes, yes they do

Profile icon
programmeruser

@CSharpIsGud
defend print evaluate loop

Profile icon
Whippingdot

STOP IT XD

@programmeruser

Profile icon
[deleted]

@Whippingdot
deplit lol
@programmeruser

Profile icon
SleepySid

CsharpIsGud

Profile icon
Whippingdot

Yes C# might be good, we can have a conversation on that if you want...

@SudhanshuMishra

Profile icon
CSharpIsGud

@Whippingdot
It's better than java at least. I think I know what my next post is going to be too.

Profile icon
Whippingdot