Live data from Hacker News

A small but complete JavaScript engine

bellard.org

61–70 of 151 posts

Re: A small but complete JavaScript engine

#61

Bellard is actually a genius, right? What's his secret? The project list at bellard.org is impressive.

He's in his 50s keep in mind. Most people of his productivity get shoved into management long before his age. He's very good but it's not like he did ffmpeg last week and QuickJS this week.

Some people are just born to be able to work all day all week, if you are one of those people please don't throw it away (I am not one of them). I think I have the knowledge to do most of his projects e.g. I have the mathematics, and RF engineering to do (say) the LTE stuff but there is absolutely no way in hell I could ever sit down and write it (I've done my own RF projects but I burn out so quickly).

Re: A small but complete JavaScript engine

#62
post #19

Earlier quoted context omitted.

I realize you're joking, but a company called Samsung actually did something similar already: https://nodejs.org/

Serious question, why is this a joke? Couldn't javascript be just another language to replace bash?

I guess, but I think JS is to far away from C to be worth it. This is saying a lot coming from me, but I would rather write python - at least longs would be the right length (if you catch my drift)

Re: A small but complete JavaScript engine

#64

It look like good (including there are some good features that I do not see in other implementations), although there are some things which may help: - Support ISO-8859-1 encoding (true ISO-8859-1 encoding, not Windows-1252) in addition to UTF-8, for all of the functions that can read text from files and write text to files, to avoid having to implement it by yourself one byte at a time. This is useful when you want…

true ISO-8859-1 encoding, not Windows-1252 AFAIK, 8859-1 is a subset of 1252.

Actually, true ISO-8859-1 would convert into UTF-16 simply by setting the high octet to zero.

Re: A small but complete JavaScript engine

#66
post #60

Bellard is actually a genius, right? What's his secret? The project list at bellard.org is impressive.

Genius and available time? Even if your smart but don’t have time you can’t do this volume of work.

i guess genius and have commitment?

Re: A small but complete JavaScript engine

#68
post #34

Currently composed of 85,624 lines of C code, mostly in quickjs.c (53,575 lines in that one file alone), but also with a couple other large ones. I can't say I understand the reason for such massive files. Surely it would be easier to maintain if it was split into a few well-defined modules? In addition to the maintenance concerns, a JavaScript engine has quite a few parts that could be used as individual components.…

One advantage of using multiple files is that you can have functions that are private to the file (static functions). So when looking at a specific file you know it can use either functions in this specific file or functions #include-d from other files. But it cannot use the private functions of other non-included files.

This reduces the cognitive load and gives the compiler a way to enforce separation.

In short - files in C can give you namespaces -- which are sometimes a useful way to organize code.

Re: A small but complete JavaScript engine

#69

Earlier quoted context omitted.

As far as does this implement enough JavaScript features for websites to run, https://test262.report/ looks really promising! You would have to hook it up to DOM and network and all sorts of other APIs normally provided by browsers, though. One reason you might not want to build a general-use browser on QuickJS is performance. QuickJS is one of the fastest JS interpreters in its weight class, but engines like V8 achi…

Also QuickJS only gets security research done on it for fun: https://twitter.com/qwertyoruiopz/status/1150490648275034112

In fairness, there's much less exploitable area in an engine without JIT.

Re: A small but complete JavaScript engine

#70
post #61

Bellard is actually a genius, right? What's his secret? The project list at bellard.org is impressive.

He's in his 50s keep in mind. Most people of his productivity get shoved into management long before his age. He's very good but it's not like he did ffmpeg last week and QuickJS this week. Some people are just born to be able to work all day all week, if you are one of those people please don't throw it away (I am not one of them). I think I have the knowledge to do most of his projects e.g. I have the mathematics,…

> get shoved into management long before his age.

Problem is that management pays so much better than a contributor of code. Society has collectively decided that management is worth more economically, than individual contributors.

Post reply on HN