Live data from Hacker News

500 Lines or Less (2016)

aosabook.org

31–40 of 45 posts

Re: 500 Lines or Less (2016)

#31
post #14
post #10

One of my goals is to rewrite all software for developing software, with each application at about (or less than) this sweet spot. Database, version control, runtime type system (Lua), proto-like serialization, code refactoring, parsing library... The list goes on. About the only heavy thing will be the text editor, and I'm still keeping that at a few thousand lines (+ a small core data structure library). When you c…

You want to write a serious database in 500 lines. Honestly, I'd be impressed but it's a hell of a target. Err, how long are your lines going to be?

To support the claim that 500 lines might be hard, Berkeley DB and Sqlite about about 200k lines. They are relatively simple databases. Maybe something like LevelDB would be less?

Re: 500 Lines or Less (2016)

#32

Hmm. I get the sentiment (500, i.e. not too short, not too long), but 500 lines will mean different things for different people and different programming stacks. It literally can mean 50000 vs 500 "lines of knowledge" required. I'm not sure why would you name your book like that. Consider: 500 lines of defensively written web server C++ code. 500 lines of C driver code. 500 lines of assembly. 500 lines of php script.…

[deleted]

Re: 500 Lines or Less (2016)

#34
post #27
post #21

Earlier quoted context omitted.

Normal lines (max 80) but I do prefer having each line do "one full thought", like putting `if then ... end` on a single line (if it fits) I wrote about the database here https://github.com/civboot/civboot/blob/main/blog/0012-dev-l...

Woof. Man, I really don't think you understand what goes into a DB if you think you can do D in 500 or even 5000 lines, unless maybe, maybe, you're aiming for something so simple it's merely a toy.

It would be considered a toy by most yes

Re: 500 Lines or Less (2016)

#35

Hmm. I get the sentiment (500, i.e. not too short, not too long), but 500 lines will mean different things for different people and different programming stacks. It literally can mean 50000 vs 500 "lines of knowledge" required. I'm not sure why would you name your book like that. Consider: 500 lines of defensively written web server C++ code. 500 lines of C driver code. 500 lines of assembly. 500 lines of php script.…

The seemingly arbitrary limit also helps to guide the choice of language: if it's too verbose in one language, it's probably the wrong one for the job! (I.e., reinventing too many wheels, un-ergonomic language patterns vs domain logic, etc.)

Re: 500 Lines or Less (2016)

#36
This seems cool and all, and I seldom critique web page design because... hey... I've developed some very crappy looking web pages. But... the designer of this page made it's width wider than a typical desktop browser window and much wider than a typical mobile phone. I turned my 10" tablet into landscape mode and it was still wider than would fit on the screen without scrolling.

I know all the cool kids are doing this, because it's only old people who care about the ease of reading things on the web. But... please... don't do stupid things like this.

That being said, it's easy enough to open dev tools and unclick the ``width: 68rem;`` clause or open it in lynx which replaces the web designer's styling stupidity with its own, more consistent styling stupidity. The content wasn't that bad.

Re: 500 Lines or Less (2016)

#37
post #26
post #10

One of my goals is to rewrite all software for developing software, with each application at about (or less than) this sweet spot. Database, version control, runtime type system (Lua), proto-like serialization, code refactoring, parsing library... The list goes on. About the only heavy thing will be the text editor, and I'm still keeping that at a few thousand lines (+ a small core data structure library). When you c…

Arthur Whitney had a whole operating system, kOS, in a few hundred lines iirc (including bare metal storage drivers, screen drivers, file system and more), with a more-than-sql database in 200 lines and an editor in a few tens. The magic — other than Arthur’s genius - was the programming language K (also designed and implemented by Arthur). And from another direction, the STEPS project from Alan Kay did a metal-to-ev…

Yup, I've seen a lot of those. Cool and inspirational stuff.

My favorite so far has been project Oberon. I've not seen how it's assembler works though. What I want is a full stack (assembly included) self-bootsrapping implementation

Re: 500 Lines or Less (2016)

#38
post #26
post #10

One of my goals is to rewrite all software for developing software, with each application at about (or less than) this sweet spot. Database, version control, runtime type system (Lua), proto-like serialization, code refactoring, parsing library... The list goes on. About the only heavy thing will be the text editor, and I'm still keeping that at a few thousand lines (+ a small core data structure library). When you c…

Arthur Whitney had a whole operating system, kOS, in a few hundred lines iirc (including bare metal storage drivers, screen drivers, file system and more), with a more-than-sql database in 200 lines and an editor in a few tens. The magic — other than Arthur’s genius - was the programming language K (also designed and implemented by Arthur). And from another direction, the STEPS project from Alan Kay did a metal-to-ev…

I was always disappointed that STEPS was something that produced a few research papers, but didn't produce an ongoing open source project that people could try out and innovate on top of. Seems like a waste of funding.

Re: 500 Lines or Less (2016)

#39
post #27
post #21

Earlier quoted context omitted.

Normal lines (max 80) but I do prefer having each line do "one full thought", like putting `if then ... end` on a single line (if it fits) I wrote about the database here https://github.com/civboot/civboot/blob/main/blog/0012-dev-l...

Woof. Man, I really don't think you understand what goes into a DB if you think you can do D in 500 or even 5000 lines, unless maybe, maybe, you're aiming for something so simple it's merely a toy.

To be clear, it would depend on some (equally small) libraries, so it's not like 500 lines of no dependency C or something

Re: 500 Lines or Less (2016)

#40
post #39
post #27

Earlier quoted context omitted.

Woof. Man, I really don't think you understand what goes into a DB if you think you can do D in 500 or even 5000 lines, unless maybe, maybe, you're aiming for something so simple it's merely a toy.

To be clear, it would depend on some (equally small) libraries, so it's not like 500 lines of no dependency C or something

I think what you're suggesting it is possible, to get halfway decent database using components, but I think you need to take a very high level view of these components. For a start, a parser. You almost certainly want a parser generator because that can be reused in other places. You need stuff to handle low level disc writes with logging, again, as a pluggable component (or maybe not, if you plan to shovel everything through your database [to clarify, that your DB effectively becomes the usual end to your filesystem, and everyone uses that, which isn't a terrible idea] in which case it's only got to be written once). You need an optimiser for the queries, even 'simple' ones. For this you might need a prolog-like facility, which again would be useful in other places. [to clarify, a prolog-like component system with some constraint+costs solver component built on top]

You'll need a lot more than that as well. You will have to take a very high level view of things, ruthlessly componentised.

I understand and endorse what you're trying to do, but a low level infrastructure with a bunch of libraries isn't quite going to cut it.

Just my opinion anyway, take it as you will!

Post reply on HN