HNHacker News
TopNewBestAskShowJobs

nalgeon

6,898 karma · joined December 12, 2016

antonz.org
submissionscomments
nalgeon··on PGlite – Postgres in WASM
Fitting PostgreSQL into a 12MB binary with a simple API is amazing!

I was so excited to try it out it that I just released an in-browser PostgreSQL playground on top of PGlite.

It's also open source and easy to integrate:

https://codapi.org/postgres-pglite

nalgeon··on A visual interactive guide to Bloom filters
Sam's visual tutorials are as good as ever (doggos are very important, by the way).

And if you want to try some code, I've prepared three toy Bloom filter implementations to accompany the article:

JavaScript: https://codapi.org/embed/?engine=browser&sandbox=javascript&...

Python: https://codapi.org/embed/?sandbox=python&src=gist:e7bde93f98...

Go: https://codapi.org/embed/?sandbox=go&src=gist:e7bde93f98c5e4...

nalgeon··on Observable 2.0, a static site generator for data apps
And if you want a simpler tool for creating interactive docs, maybe try Codapi:

https://codapi.org/

nalgeon··on Go 1.22
They are correct.

> Functions that shrink the size of a slice (Delete, DeleteFunc, Compact, CompactFunc, and Replace) now zero the elements between the new length and the old length.

nalgeon··on Go 1.22
If you find the official release notes a bit dry, I've made an interactive version: https://antonz.org/go-1-22
nalgeon··on Sqlite3 Utility in the Browser
You can also embed SQLite shell into your blog or product documentation: https://codapi.org/sqlite-wasi
nalgeon··on SQLite 3.45 released with JSONB support
If you find the official release notes a bit dry, I've made an interactive version:

https://antonz.org/sqlite-3-45

nalgeon··on In-browser code playgrounds
I guess you can prepare the necessary packages and mount them in the WASI file system for the Python binary (WASI allows this). Then you can import these packages in your Python code.

I haven't tried this though :)

nalgeon··on In-browser code playgrounds
This approach would allow you to run a pre-built Python program in the browser, but not change the code and re-run it.

This kind of defeats the idea of interactive code snippets in the docs (but might still be useful in other use cases).

nalgeon··on In-browser code playgrounds
I can, but I usually don't want to :) I'd rather not force everyone who happens to open the page to download 20 MB before they decide to interact with the code.

The network may be fast and the traffic cheap in some parts of the world, but not in others.

nalgeon··on Learn Modern C++
Maybe one day someone will rate all "Modern C++" tutorials according to their level of modernity :)
nalgeon··on Trying chDB, an embeddable ClickHouse engine
In terms of SQL syntax supported, you can compare them here[1]. As for performance, it probably comes down to "clickhouse-local vs. DuckDB", and there was an interesting post about this some time ago[2].

[1]: https://codapi.org/sql

[2]: https://www.vantage.sh/blog/clickhouse-local-vs-duckdb

nalgeon··on Interactive Code Cells
It's a bit tricky, but possible, yes.
nalgeon··on Interactive Code Cells
These are code snippets, not Linux builds :) They tend to be fast enough to run from scratch.
nalgeon··on Interactive Code Cells
The examples in this article use the "basic" editing mode (which I personally prefer).

There is also an "external" mode where you can use a full-featured editor with syntax highlighting, etc. For example:

https://codapi.org/python

nalgeon··on Interactive Code Cells
I think it would! Are you interested in trying it out? I can probably prepare a simple example and open an issue in the pgsodium repo to discuss the rest.
nalgeon··on Interactive Code Cells
In this case, running sandboxes does not consume resources when idle. There is no state, and the containers exist only for the duration of the "run" operation.
nalgeon··on Interactive Code Cells
Yeah, one of the many abandoned Mozilla projects.
nalgeon··on Interactive Code Cells
Let's go through these one by one :)

> does it memoize dependencies?

Not sure what do you mean by memoization here, but there is no stored state at all (see the original post for the reasoning behind this).

> if i have several cells that all depend on a central one, will the central one only run once?

Sure!

> can you declare a variable in one cell then use it in another?

You can, as long as it's in global scope.

nalgeon··on Interactive Code Cells
You'd be surprised how useful they are once you've grokked them. I have a 4-part interactive tutorial on SQL window functions, if you are interested:

https://antonz.org/sql-window-functions-ranking

nalgeon··on Interactive Code Cells
Any code, really. Runs in (highly restricted) Docker containers.
nalgeon··on Interactive Code Cells
Exactly. Because of this:

> The last thing I want as a reader is code examples that fail or behave oddly because they were run out of order. Or because I didn't run some cells. Or because I changed a cell and didn't re-run it.

> Codapi code cells, unlike Jupyter's, have no hidden state. Instead, they execute the whole chain of dependencies as needed to ensure that the reader gets a consistent result.

nalgeon··on Show HN: SQL Polyglot
It's https://github.com/nalgeon/codapi
nalgeon··on Show HN: SQL Polyglot
There is no ground truth in SQL. I mean, there is a standard, but none of the vendors bother to implement it.

What SQL Polyglot can do is help you quickly check if certain database engines support a certain SQL feature.

nalgeon··on Show HN: SQL Polyglot
SQL Polyglot is really more of an education/exploration thing.

And yes, I should definitely increase the C# sandbox timeout. Will do :)

nalgeon··on Trying chDB, an embeddable ClickHouse engine
Thank you, Lorenzo! When I first read about chDB, I thought it was a great idea. When I tried the implementation, I was even more impressed! So this little tutorial was born.

I have been talking to Auxten about adding some interactivity to the code examples on doc.chdb.io, so hopefully the chDB docs will soon be even friendlier to newcomers.

nalgeon··on JSONB has landed
You can try JSONB in the pre-release snapshot [1] or live in the playground [2].

[1]: https://sqlite.org/download.html

[2]: https://codapi.org/sqlite

nalgeon··on Show HN: SQL Window Functions Explained
Thank you! It is. The ranking article is literally a chapter from the book.
nalgeon··on GitHub faces backlash after enforcing an algorithmic feed
I've submitted it because it's been two days and absolutely no reaction from GitHub. I'd really like to hear from them.
nalgeon··on GitHub faces backlash after enforcing an algorithmic feed
...and chooses to just ignore it. Not rolling back the changes, not responding to the criticism, nothing.

Disappointing.

← PreviousPage 2 of 4Next →