Live data from Hacker News

500 Lines or Less (2016)

aosabook.org

41–45 of 45 posts

Re: 500 Lines or Less (2016)

#41
post #40
post #39

Earlier quoted context omitted.

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 everythin…

Thanks, I appreciate the thoughts.

It's for the civboot.org project, so it has VERY constrained requirements. Basically it is just to build things like a VCS and log collector on.

As I outlined in the post I'm only concerned with two requirements: appending mutation quickly and indexing static databases. If I add an in-memory index for recent writes that haven't yet been indexed then it pretty much meets all requirements.

I don't plan on supporting SQL or anything like that -- it's a single-file database that Lua can (indexed) read and write to. Others can also trivially read the index as well, but concurrent writes are probably not going to be possible. Transactions are easy enough I think.

Re: 500 Lines or Less (2016)

#42
post #15

"500 lines" is meaningles without talking into accont its dependencies, that including the SDK. Corpos will see "500 lines" whatever the dependencies, serious software will embrace the whole software namely with the SDK and dependencies.

Exactly... Given the right library I could write a one line program that does the same as a 500 lines program

Re: 500 Lines or Less (2016)

#43
post #15

"500 lines" is meaningles without talking into accont its dependencies, that including the SDK. Corpos will see "500 lines" whatever the dependencies, serious software will embrace the whole software namely with the SDK and dependencies.

Exactly... Given the right library I could write a one line program that does the same as a 500 lines program

Yep, all that "line" thingy is meaningless, and it is even worse when you are serious enough to consider the life cycle of many pieces of software (does not work with all software).

From a life cycle (and more) perspective, it can be very "better" to write some software with 1000 lines with less deps than 10 with more deps...

Re: 500 Lines or Less (2016)

#44
post #41
post #40

Earlier quoted context omitted.

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 everythin…

Thanks, I appreciate the thoughts. It's for the civboot.org project, so it has VERY constrained requirements. Basically it is just to build things like a VCS and log collector on. As I outlined in the post I'm only concerned with two requirements: appending mutation quickly and indexing static databases. If I add an in-memory index for recent writes that haven't yet been indexed then it pretty much meets all requirem…

Hi, then a database is not much more than an indexed file system (sort of). I'll check out your link in a bit more detail, thanks.

I wasn't expecting it to be multiple user, I assumed single use only which seriously simplifies some aspects (lock the world, do stuff, unlock). To support transactions you'll need a write ahead log and recovery to preserve data through crashes/power loss – that's not trivial. Still, good luck.

Regarding your processor, I like the idea of a very simple process are easy to produce. I haven't looked at what you're suggesting but perhaps instructions on making a full-sized one out of discrete components might be worthwhile? There are a few projects online (I haven't been able to find them but I seem to remember a 6502 made by hand the size of a mattress). While this would only run at a few kilohertz, it's better than no computer at all and useful for bootstrapping to something smaller, and possible if you've got no VLSI or anything similar. An even simpler processor might be possible. Sorry if you've already considered this, it was just a thought.

Re: 500 Lines or Less (2016)

#45
post #44
post #41

Earlier quoted context omitted.

Thanks, I appreciate the thoughts. It's for the civboot.org project, so it has VERY constrained requirements. Basically it is just to build things like a VCS and log collector on. As I outlined in the post I'm only concerned with two requirements: appending mutation quickly and indexing static databases. If I add an in-memory index for recent writes that haven't yet been indexed then it pretty much meets all requirem…

Hi, then a database is not much more than an indexed file system (sort of). I'll check out your link in a bit more detail, thanks. I wasn't expecting it to be multiple user, I assumed single use only which seriously simplifies some aspects (lock the world, do stuff, unlock). To support transactions you'll need a write ahead log and recovery to preserve data through crashes/power loss – that's not trivial. Still, good…

Ya, basically just a file you dump things at in incrementing indexes and a index file to quickly look up keys.

Your other comments are the kinds of thoughts I approach this with. I'm hoping for the final (simple fab) CPU @100MHz and at least a few MiB of RAM (I think about 1990's tech).

I did the pre-work in thinking about the CPU and hardware to convince myself of what features were needed. Eventually I'll get to building the CPU itself. I first want the OS it will target :)

Post reply on HN