News for hackers. Stuff that matters.
Re:QuickJS JavaScript Engine by pcwalton on Thursday July 11, 2019 @12:43PM (#20413025)
quickjs.c is a 47,842 line C file. I think that sets the record for the largest handwritten file I've seen.
Re:QuickJS JavaScript Engine by kizer on Thursday July 11, 2019 @04:04PM (#20415246)
Although decomposition into corresponding files is the norm, it’s so satisfying to say “hey, check out my JS engine” and point people to a single work-of-art uberfile. LOL.
Re:QuickJS JavaScript Engine by dang on Thursday July 11, 2019 @07:44PM (#20416910)
"Don't be snarky."

"Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something."

https://news.ycombinator.com/newsguidelines.html

Re:QuickJS JavaScript Engine by kizer on Thursday July 11, 2019 @09:59PM (#20417491)
It wasn’t sarcasm. I was being sincere.
Re:QuickJS JavaScript Engine by dang on Thursday July 11, 2019 @11:52PM (#20417979)
I believe you, but a comment like that is going to pattern-match to the internet default, which is snark, in nearly every reader's mind.
Re:QuickJS JavaScript Engine by ibly31 on Saturday July 13, 2019 @11:11PM (#20431417)
I think you are overreacting here, his comment was definitely not interpreted as sarcastic. Quite the opposite, it was showing appreciation for what an achievement QuickJS is.
Re:QuickJS JavaScript Engine by kizer on Thursday July 11, 2019 @09:58PM (#20417488)
I was not being sarcastic!!
Re:QuickJS JavaScript Engine by munificent on Thursday July 11, 2019 @12:49PM (#20413101)
Is it hand-written as a single file, though? I'm assuming the release is the output of some script that does concatenation.
Re:QuickJS JavaScript Engine by phaer on Thursday July 11, 2019 @02:39PM (#20414180)
Some editors, like Emacs, make it very easy to work with one huge file, because you can have multiple independent views ("windows" in Emacs parlance) into the same file. It is - or maybe has been - quite common to work like this in LISP communities.
Re:QuickJS JavaScript Engine by Arelius on Thursday July 11, 2019 @03:22PM (#20414698)
Yes.

As an Emacs programmer, I much prefer working in one 10kloc file than 20 500loc files. The later I find pretty overwhelming.

Re:QuickJS JavaScript Engine by Keyframe on Thursday July 11, 2019 @04:53PM (#20415718)
To bring some balance to the universe - as a vim user, I tend to prefer doing the same.
Re:QuickJS JavaScript Engine by saagarjha on Thursday July 11, 2019 @01:30PM (#20413518)
From a cursory glance, it doesn't look like it's a bunch of files concatenated together.
Re:QuickJS JavaScript Engine by krferriter on Thursday July 11, 2019 @03:27PM (#20414780)
It's C so it's harder to tell than other languages, since it doesn't have separate namespaces for everything. You can just write a bunch of functions and global variables in separate files and then act like they're all in the same file, and there's really no difference.
Re:QuickJS JavaScript Engine by saagarjha on Thursday July 11, 2019 @05:52PM (#20416224)
You could, but I'm not seeing any code duplication across files so that would mean that he's not included the files that make up the "mega file", which would be rather strange.
Re:QuickJS JavaScript Engine by mantap on Thursday July 11, 2019 @09:54PM (#20417478)
Not really that strange. You can have one C file that #includes the separate files that make up the big translation unit. The compiler will give you an error if a declaration is out of order.
Re:QuickJS JavaScript Engine by fightingcat on Sunday July 14, 2019 @01:56AM (#20431893)
Any chance he has a super loooong screen? XD