Better HN
topnewbestaskshowjobs
Log inSign up

gopiandcode

1,210 karma · joined Jun 5, 2019 (7y ago) · 194 submissions

pronouns: she/her

url: kirancodes.me

Submissions

31.

Vibe-Coding a Verified Compiler (JS-2-WASM)(docs.google.com ↗)

3 points · by gopiandcode · 9mo ago · 1 comment

comment 1y ago · link · parent

If it has become a cult, it's become a cult that has infiltrated so far as DARPA - see their TRACTOR program (https://www.darpa.mil/research/programs/translating-all-c-to...)

I think couching the success and excitement around rust to ideology or a "cult" as you say is somewhat digging your head into the sand. There are concrete facts and results. Rust is empirically producing levels of memory safety that humanity did not think was possible with software at scale. This is truly groundbreaking.

comment 1y ago · link · parent

So to clarify, the crusade to rewrite things in Rust is not my fight. To be honest, I'm more a third party watching from the sidelines. There seems to be big institutional interest in replacing C with Rust. Not for ideological reasons. Just for plain economic ones. Rust code is breaking industry standards of memory safety/bug density/review time. I link it in the article, but for example, darpa has a recent big grant program, TRACTOR: Translating All C to Rust (https://www.darpa.mil/research/programs/translating-all-c-to...).

My article was more a commentary aimed at the efforts towards doing that. In some sense arguing that there are some foundational formal deficiencies currently that mean that it's not even clear what success would be. I guess I don't really take a position on the value of rewriting things into Rust, aside from adopting the views of these existing programs as some prelude.

comment 1y ago · link · parent

w.r.t the first point, so ideally you wouldn't want to do that because it'd incur a heavy runtime performance. Rust's memory analysis allows eliminating those kinds of memory bugs without having to check writes at runtime.

w.r.t the second point, I talk a bit about that in the article itself -- the fundamental problem right now is that there's no real formal way of even stating what it means to correctly translate a program from C to Rust. We could maybe have a smart LLM that translates things to Rust, but would you trust it without tests? or ideally a proof of correctness? what properties should we test? etc.

35.

Humanity is stained by C and no LLM can rewrite it in Rust(kirancodes.me ↗)

3 points · by gopiandcode · 1y ago · 9 comments

comment 1y ago · link · parent

oh yep, it's definitely more than usable for 'actual programming' beyond just maths proofs.

Things like:

- bindings to godot (https://github.com/kiranandcode/lean4-godot)

- advent of code (https://github.com/kiranandcode/lean-aoc)

- ffi bindings to constraint solvers (https://github.com/kiranandcode/cleango/)

Obviously a slightly biased selection here, but the key point is to clarify that it's more than feasible to use it for real programs that do all sorts of non-mathy stuff.

37.

Why Lean 4 replaced OCaml as my Primary Language(kirancodes.me ↗)

27 points · by gopiandcode · 1y ago · 5 comments

comment 1y ago · link · parent

Arguably it really depends on your DSL right? If it has a semantics that already lies close to existing programming languages, then I'd agree that a few examples might be sufficient, but what if your particular domain doesn't match as closely?

Examples of domains that might be more challenging to design DSLs for: languages for knitting, non-deterministic languages to represent streaming etc. (i.e https://pldi25.sigplan.org/details/pldi-2025-papers/50/Funct... )

My main concern is that LLMs might excel at the mundane tasks, but struggle at the more exciting advances, and so now the activation energy for coming up with advances DSLs is going to increase and as a result, the field might stagnate.

comment 1y ago · link · parent

Oh that's a great blog post and a very interesting point. Yep, I hadn't considered how LLMs would affect frameworks in existing languages, but it makes sense that there's a very similar effect of reinforcing the incumbents and stifling innovation.

I'd argue that the problem of solving this effect in DSLs might be a bit harder than for frameworks, because DSLs can have wildly different semantics (imagine for example a logic programming DSL a la prolog, vs a functional DSL a la haskell), so these don't fit as nicely into the framework of MCPs maybe. I agree that it's not unsolvable though, but it definitely needs more research into.

comment 1y ago · link · parent

mhhm yes yes. There's a thread of discussion that I didn't quite chose to delve into in the post, but there is something interesting to be found in the observation that languages that are close to natural language (Python being famous for being almost executable pseudo-code for a while) being easier for LLMs to generate.

Maybe designing new languages to be close to pseudo-code might lead to better results in terms of asking LLMs to generate them? but there's also a fear that maybe prose-like syntax might not be the most appropriate for some problem domains.

41.

LLMs pose an interesting problem for DSL designers(kirancodes.me ↗)

220 points · by gopiandcode · 1y ago · 151 comments

42.

The looming problem of slow and brittle proofs in SMT verification(kirancodes.me ↗)

4 points · by gopiandcode · 1y ago · discuss

comment 1y ago · link · parent

Ahh, that is a valid point; so it's not quite as clear as using something like quick check, but it does feel like there is increasing interest and activity in people trying out doing exploratory maths in Lean itself.

I mention it in the blog post, but one project in that direction is Terence Tao's equational_theories project (https://teorth.github.io/equational_theories/), where it seems like a bunch of hobbyists and mathematicians are working together using Lean to prove new mathematics enabled by Lean.

comment 1y ago · link · parent

Fwiw there's also an Emacs plugin which is what I use and it works really well.

For using Lean as a theorem prover, this book is pretty good: https://github.com/lean-forward/logical_verification_2024

Also, Lean is also remarkably usable as a programming language itself, which might give an easier onboarding ramp: https://lean-lang.org/functional_programming_in_lean/

comment 1y ago · link · parent

Oh, really? I'm curious what exactly you mean by limitless metaprogramming. I've really been drawn into Lean specifically because of how easy to extend and malleable the language itself is, so if Agda is even more so then I'd be really eager to try that out.

e.g.:

- embedding a prolog/asp DSL: https://github.com/kiranandcode/cleango

- embedding a tex/latex DSL: https://github.com/kiranandcode/LeanTeX

46.

How to (actually) prove it – New Frontiers of Mathematics and Computing in Lean(kirancodes.me ↗)

81 points · by gopiandcode · 1y ago · 17 comments

comment 1y ago · link · parent

I am more than aware of Typescript, you seem to have misunderstood my point: I was not describing a particular type system (of which there have been many of this ilk) but rather conjecturing that targeting interfaces specifically might make LLM-based code generation/type inference more effective.

comment 1y ago · link · parent

The visualisation of how the model sees nullability was fascinating.

I'm curious if this probing of nullability could be composed with other LLM/ML-based python-typing tools to improve their accuracy.

Maybe even focusing on interfaces such as nullability rather than precise types would work better with a duck-typed language like python than inferring types directly (i.e we don't really care if a variable is an int specifically, but rather that it supports _add or _sub etc. that it is numeric).

49.

Functional vs. Data-Driven Development: A Case-Study in Clojure and OCaml(kirancodes.me ↗)

6 points · by gopiandcode · 1y ago · 1 comment

comment 2y ago · link · parent

I find this particular choice of syntax somewhat amusing because the pipe notation based query construction was something I ended up using a year ago when making an SQL library in OCaml:

https://github.com/kiranandcode/petrol

An example query being:

```

let insert_person ~name:n ~age:a db = Query.insert ~table:example_table ~values:Expr.[ name := s n; age := i a ] |> Request.make_zero |> Petrol.exec db

```

51.

LeanSSR: An SSReflect-Like Tactic Language for Lean(github.com ↗)

2 points · by gopiandcode · 2y ago · discuss

comment 3y ago · link · parent

Please also consider how much less inclusive and accessible computing would be if access to development tooling was placed behind such exorbitantly priced paywalls... The things we have at the moment aren't perfect, but I feel like the fact that the barrier of entry to programming is so low is an overwhelming positive that I couldn't see any level of bells and whistles justifying taking it away.

53.

Sisyphus – Mostly Automated Proof Repair for Verified Libraries(verse-lab.github.io ↗)

2 points · by gopiandcode · 3y ago · discuss

54.

Rhombus in the Rough: A 2D RPG implemented in the Rhombus Racket Lisp dialect(github.com ↗)

2 points · by gopiandcode · 3y ago · discuss

55.

Petrol: Embedding a type-safe SQL API in OCaml using GADTs(gopiandcode.uk ↗)

3 points · by gopiandcode · 3y ago · discuss

56.

I Wrote an Activitypub Server in OCaml: Lessons Learnt, Weekends Lost(gopiandcode.uk ↗)

154 points · by gopiandcode · 3y ago · 108 comments

1234567