Live data from Hacker News

Why Is SQLite Coded In C

sqlite.org

291–300 of 411 posts

Re: Why Is SQLite Coded In C

#291

Earlier quoted context omitted.

> We attempted to move into Go […], but similar to interpreted languages it can be rather hard to optimize it. […] So it was easier to just go with Python I don’t get that. You had trouble optimizing Go, so you went with Python?

Python + C . Probably C for the optimized parts.

Why not Go + C then?

Re: Why Is SQLite Coded In C

#292
post #186

Earlier quoted context omitted.

C is so simple, that you will need to read a 700-page, comitee-written manual befor you can attempt to write it correctly.

> C is so simple, that you will need to read a 700-page, comitee-written manual befor you can attempt to write it correctly. The official C99 standard document is typically about 210 pages.

Except the little detail that you need to complement that with all the manuals of the C compilers being used.

Re: Why Is SQLite Coded In C

#293
post #131

Earlier quoted context omitted.

Is SQLite looking for new developers? Will they ever need a large amount of developers like a mega-corp that needs to hire 100 React engineers?

No, but as morbid as this sounds, the three(?) devs one day will pass away so now what?

Well the point is that it’s not hard to find 3 people who are C experts. Yes, even young ones.

Re: Why Is SQLite Coded In C

#294
post #204

Earlier quoted context omitted.

It is. You can also write it in C++ or Rust and expose a C API+ABI, and then you're distributing a binary library that the OS sees as very similar to a C library. Occasionally when working in Lua I'd write something low-level in C++, wrap it in C, and then call the C wrapper from Lua. It's extra boilerplate but damn is it nice to have a REPL for your C++ code. Edit: Because someone else will say it - Rust binary arti…

> It is. You can also write it in C++ or Rust and expose a C API+ABI, and then you're distributing a binary library that the OS sees as very similar to a C library. If I want a "C Library", I want a "C Library" and not some weird abomination that has been surgically grafted to libstdc++ or similar (but be careful of which version as they're not compatible and the name mangling changes and ...). This isn't theoretical…

As someone that also cares about C++, header-only libraries are an abomination from folks that think C and C++ are scripting languages.

Re: Why Is SQLite Coded In C

#295

Earlier quoted context omitted.

> How do you do conditional compilation in Go (at the level of conditionally including or not including a statement)? https://stackoverflow.com/questions/36703867/golang-preproce... Wouldn't this work? Surely the empty function would be removed completely during compilation?

That builds or doesn't an entire file. Assert works as a statement. There is not an equivalent in Go to conditionally removing just a statement in a function based on a compile time option.

Can’t you include or not include a function that contains a single assert, and depending on the condition, the function call is removed or included?

Re: Why Is SQLite Coded In C

#297
post #242

Earlier quoted context omitted.

"SQLite could be recoded in Go or Rust, but doing so would probably introduce far more bugs than would be fixed, and it may also result in slower code." We will see. On the Rust side there is Turso which is pretty active. https://turso.tech/

The Sqlite team in stuck in the classic dilemma. They are stuck with their existing thing because it is so big, that you can't just stop the world for you existing users and redo it. Meanwhile some small innovator comes along and builds the next thing because why not, they don't have anything holding them back. This is classic Innovator's Dilemma and Creative Destruction. This has of course not happened yet and we ha…

You say that like SQLite is a for profit company competing for market share or one of several rival projects in a corporation trying to not be canceled.

It's an open sourced project! It's public domain!

If you make an open source project that is heavily used and widely lauded for a quarter century before being supplanted by a newer solution that's better, do you know what that is?

A success! You did it! You made a thing that was useful and loved!

Nothing lasts forever; there's nothing wrong with a project filling a niche and then gracefully fading away when that niche goes away.

Re: Why Is SQLite Coded In C

#298

Earlier quoted context omitted.

That builds or doesn't an entire file. Assert works as a statement. There is not an equivalent in Go to conditionally removing just a statement in a function based on a compile time option.

Can’t you include or not include a function that contains a single assert, and depending on the condition, the function call is removed or included?

That defeats the point of asserts. Now you have two copies to keep in sync with each other, whereas asserts are inline with the rest of your code and you have one file that can be built with or without them. They could use a separate tool to produce the assert free version, but that adds tooling beyond what Go provides. Nearly every mainstream language allows you to do this without any extra steps, except Go.

Re: Why Is SQLite Coded In C

#299
post #242

Earlier quoted context omitted.

The Sqlite team in stuck in the classic dilemma. They are stuck with their existing thing because it is so big, that you can't just stop the world for you existing users and redo it. Meanwhile some small innovator comes along and builds the next thing because why not, they don't have anything holding them back. This is classic Innovator's Dilemma and Creative Destruction. This has of course not happened yet and we ha…

You say that like SQLite is a for profit company competing for market share or one of several rival projects in a corporation trying to not be canceled. It's an open sourced project! It's public domain ! If you make an open source project that is heavily used and widely lauded for a quarter century before being supplanted by a newer solution that's better, do you know what that is? A success! You did it! You made a t…

Funny you should say so because I actually made an effort _not_ to use corporate business terms, because open source project definitely do compete with each other both for developer and user attention and for general prestige, which in turn may be leveraged to get access to funding and other development resources in various ways. And in an even funnier turn of events Sqlite development is actually funded by a for-profit company that sells Sqlite support contracts: https://www.sqlite.org/consortium.html

Re: Why Is SQLite Coded In C

#300
post #290

Earlier quoted context omitted.

My point is that the original Mac used little to no Pascal. The assembly isn’t a “rebuttal,” it’s just what was actually used.

Sure if the only thing that matters is what happened in 1990, and nothing else that came afterwards. Also if we ignore the historical tellings from Apple employees at the time, in places like the Folklore book and CHM interviews.

What is with people on HN using a specific example and then getting annoyed when I respond to it? You specifically said Apple launched the original Mac without C. Which is true, but the implication that it used Pascal is not. I'm not addressing what happened years later.

Can you elaborate on these historical tellings? From what I found on folklore.org, Lisa OS had a bunch of Pascal, and the Mac system borrowed a bunch of Lisa code, but it was all hand-translated to assembly in the process.

Post reply on HN