HackerTrans
TopNewTrendsCommentsPastAskShowJobs

mjaniczek

449 karmajoined há 10 anos
https://bsky.app/profile/janiczek.cz https://github.com/janiczek

Submissions

[untitled]

1 points·by mjaniczek·há 5 meses·0 comments

FAWK: LLMs can write a language interpreter

martin.janiczek.cz
2 points·by mjaniczek·há 8 meses·0 comments

[untitled]

1 points·by mjaniczek·há 9 meses·0 comments

comments

mjaniczek
·há 6 dias·discuss
Thank you for another check on my bingo card.
mjaniczek
·há 3 meses·discuss
Oh cool, I have to try these fonts on my amber CRT getting commands from an Elm webapp ([demo](https://youtu.be/M9Q5tFPtGaA?t=121), [code](https://github.com/Janiczek/crt-esp32-elm/tree/main/vdom/)) - there's not a lot of real estate in a 400x240 NTSC resolution. But the scanlined rendering has so much charm!

EDIT: realized a better demo for this discussion would be the photos I took of all the tiny bitmap fonts I had converted to the C array style at the time. Thread has more but here are my favorites: https://bsky.app/profile/janiczek.cz/post/3mh25atboz224
mjaniczek
·há 5 meses·discuss
The choice to use Count was made before I joined the company; IIRC they migrated to it from Tableau.

We wanted to migrate (to Streamlit, back then) to have the SQL not live locked in a tool, but inside our git repository; to be able to run tests on the logic etc. But the spaghetti mess was felt too, even if it wasn't the main reason to switch.

(But then, 1) some team changes happened that pushed us towards Metabase, and 2) we found that Streamlit managed by Snowflake is quite costly, compute-time wise. (The compute server that starts when you open a Streamlit report, stays live for tens of minutes, which was unexpected to us.)

----

Export to DBT sounds great. Count has "export to SQL" which walks the graph of the cell dependencies and collects them into a CTE. I can imagine there being a way to export into a ZIP of SQL+YML files, with one SQL file per cell.
mjaniczek
·há 5 meses·discuss
Look at count.co for a Figma-like approach to databases.

We were using it at work (transitioning to Metabase); it's great for exploring and debugging and prototyping but it ends up too much of a tangled spaghetti mess for anything long-term. Would not recommend for user-/other-company-departments-facing reports or dashboards.
mjaniczek
·há 5 meses·discuss
I'm optimizing performance of PBT generation and shrinking in [elm-test](https://github.com/elm-explorations/test/compare/master...ja...) - on its own PBT-heavy test suite I got it down from 1336ms to 891ms by using JS TypedArrays.

I'm also experimenting with coverage-guided PBT input generation in the same library, AFL-style -- right now elm-test only has random input generation.
mjaniczek
·há 5 meses·discuss
It seems like the ASCII/Unicode mode doesn't work all that well: https://agents.craft.do/mermaid#sample-6
mjaniczek
·há 8 meses·discuss
It's entirely happy paths right now; it would be best to allow the test runner to also test for failures (check expected stderr and return code), then we could write those missing tests.

I think you can find a test somewhere in there with a commented code saying "FAWK can't do this yet, but yadda yadda yadda".
mjaniczek
·há 8 meses·discuss
I have only had some previous experience with Project Euler, which I liked for the loop of "try to bruteforce it -> doesn't work -> analyze the problem, exploit patterns, take shortcuts". (I hit a skill ceiling after 166 problems solved.)

Advent of Code has this mass hysteria feel about it (in a good sense), probably fueled by the scarcity principle / looking forward to it as December comes closer. In my programming circles, a bunch of people share frustration and joy over the problems, compete in private leaderboards; there are people streaming these problems, YouTubers speedrunning them or solving them in crazy languages like Excel or Factorio... it's a community thing, I think.

If I wanted to start doing something like LeetCode, it feels like I'd be alone in there, though that's likely false and there probably are Discords and forums dedicated to it. But somehow it doesn't have the same appeal as AoC.
mjaniczek
·há 8 meses·discuss
Yes, I'll only have an answer to this later, as I use it, and there's a real chances my changes to the language won't mix well with the original AWK. (Or is your comment more about AWK sucking for programs larger than 30 LOC? I think that's a given already.)

Thankfully, if that's the case, then I've only lost a few hours """implementing""" the language, rather than days/weeks/more.
mjaniczek
·há 8 meses·discuss
In my case, I can't share them anymore because "the conversation expired". I am not completely sure what the Cursor Agent rules for conversations expiring are. The PR getting closed? Branch deleted?

In any case, the first prompt was something like (from memory):

> I am imagining a language FAWK - Functional AWK - which would stay as close to the AWK syntax and feel as possible, but add several new features to aid with functional programming. Backwards compatibility is a non-goal. > > The features: > * first-class array literals, being able to return arrays from functions > * first-class functions and lambdas, being able to pass them as arguments and return them from functions > * lexical scope instead of dynamic scope (no spooky action at a distance, call-by-value, mutations of an argument array aren't visible in the caller scope) > * explicit global keyword (only in BEGIN) that makes variables visible and mutable in any scope without having to pass them around > > Please start by succintly summarizing this in the README.md file, alongside code examples.

The second prompt (for the actual implementation) was something like this, I believe:

> Please implement an interpreter for the language described in the README.md file in Python, to the point that the code examples all work (make a test runner that tests them against expected output).

I then spent a few iterations asking it to split a single file containing all code to multiple files (one per stage, so eg. lexer, parser, ...) before merging the PR and then doing more stuff manually (moving tests to their own folder etc.)

EDIT: ah, HN screws up formatting. I don't know how to enforce newlines. You'll have to split things by `>` yourself, sorry.
mjaniczek
·há 8 meses·discuss
Yes :)
mjaniczek
·há 8 meses·discuss
What is it with HN and the "oh, I thought {NAME} is the totally different tool {NAME}" comments? Is it some inside joke?
mjaniczek
·há 8 meses·discuss
Hey all, I've just added a paragraph about this. Thanks for the feedback.
mjaniczek
·há 11 meses·discuss
As much as I don't want LLMs shoved in every product I use, writing or tweaking SQL queries with knowledge of the database schema is one of the LLM uses that work well for me. I don't know if I could jump ship from Cursor/VSCore which gives me that + Vim mode.
mjaniczek
·há 2 anos·discuss
This is unproven (and not a toy problem), but I imagine it's going to do pretty well at compilers. The amount of time I'm waiting at work, hypnotizing the tsc process that sits at 100% CPU, wishing it was parallel...
mjaniczek
·há 2 anos·discuss
I think this is an unsolved tooling question right now.

You could get some sense of the parallelism by using `/usr/bin/time` and dividing the wall time with the user time.

You could look at the Task Manager / Activity Monitor / htop and see if it's using 800% CPU or whatever.

You could use psrecord (https://pypi.org/project/psrecord/) to get a relatively finegrained CPU+mem usage graph across the duration of the program.

But it would probably still be best to record some sort of stats in the Bend/HVM itself, enabled via a CLI flag. Reductions per ms, sampled across the program duration, or something like that.

I'd be interested in anybody's ideas of what a good metric would be here!

EDIT: CLI flag, not CPU flag
mjaniczek
·há 2 anos·discuss
I've made a benchmark of Bend running a simple counter program on CPU vs GPU, vs Haskell,Node,Python,C that I plan to write a blogpost about, probably this Sunday:

https://docs.google.com/spreadsheets/d/1V_DZPpc7_BP3bmOR8Ees...

It's magical how the GPU version is basically flat (although with a high runtime init cost).
mjaniczek
·há 2 anos·discuss
I've made a benchmark of the current version of Bend running a simple counter program on CPU vs GPU, vs Haskell,Node,Python,C: https://docs.google.com/spreadsheets/d/1V_DZPpc7_BP3bmOR8Ees...

It's magical how the GPU version is basically flat (although with a high runtime init cost)