Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Missing: write static python and transpile to rust pyO3 which is at the top of the ladder.

Some nuance: try transpiling to a garbage collected rust like language with fast compilation until you have millions of users.

Also use a combination of neural and deterministic methods to transpile depending on the complexity.



> a garbage collected rust like language with fast compilation

I don't know what languages you might have in mind. "Rust-like" in what sense?


Probably OCaml, Standard ML, Haskell, MLton, F#, Scala,....

If going to complain about some of those being slow, remeber that they have various options between interpreter, bytecode, REPL, JIT and AOT.


You know, I really should try out F# some time. I always preferred C# over Java, and I have some Scala experience (that wasn't overall very pleasant, but it was fun to use an FP language).


Not parent, but basically every ML? OCaml, but also Scala/Kotlin to a certain degree Java, C# are all good choices.


It's not a popular thing to say on social media.

V-lang is the one I'm tinkering with. It's like rust in terms of pattern matching as an expression, sum types, ?T instead of exceptions.

Like golang, it has shorter compile times.

I try to keep my argument abstract (that you need to lower python to something intermediate before rust) for that reason.


Here is a python AST parser written in V. It's targeting a dialect that's mostly compatible with a static subset of python3, but will break compatibility where necessary. In this case pattern matching, possibly elsewhere.

https://github.com/py2many/v-ast


Never heard of this language, but it looks interesting. Very modern, certainly. One thing that stood out to me is that there's apparently the ability to write a bare `for` loop...? Is that just equivalent to while (true) in other languages?


It can be used in many forms, while true is one of them.

I don't have a whole lot of experience hand writing v-lang. Mostly machine generated from static python.

But I find it convenient for what it does. Golang that is less verbose, single binary for distribution and fewer tokens if you're using an agent.

GitHub.com/LadybugDB/ladybug-vlang has a CLI I recently wrote with an agent for a database I maintain.

Static python with design by contract can be a stronger specification than natural language. @antirez was discussing this on his social media today.


It does have a "shady" past, but AFAIK it mostly managed to leave that vaporware behind.

Nonetheless, I would not bet anything too serious on such a small language.


What was really "shady": 1) Attempts by competitors and their minions to blank out any supporters or positive news on V. 2) Mass shadowbanning and banning of V supporters, while censoring lots of positive coverage. 3) Tipping the scales (also reflected in downvoting), by allowing lies and even direct slander from known persons of competing organizations (languages even on their profiles), while they pushed what looked like HN "favored" or "protected status" languages.

Arguably, only the explosion of AI slop (maybe it's more profitable), has slowed down the outrageous bombardment of Zig and Rust peddling. Languages which are not even in the top 10, but one would not have known that, by the number of previous HN headlines.


I will not be commenting on the topic here because of a consistent pattern of downvoting:

https://x.com/arundsharma/status/2033635906532638776

You should judge the language based on its license and what it does, not on the morality of people who wrote it and sponsored it.

Either produce an alternative language which does the same thing written by more "unshady" people and supported by a large corporation (talking about the "small language" comment here).

These human emotions won't matter in 6 months as code will be increasingly written by machines which have no such considerations.


The AI companies are arguably taking taxpayers (via electric bills) on a ride. A lot of the code, which people get fooled into thinking are AI "solutions", is code already written by humans or even stolen by disregarding licenses and copyright. A problem not just in programming, but widely complained about by book authors and artists.

The "AI" makes a few changes of the free content it sucked up, then gives it back based on correct prompts, for a fee. They got it for free, but you will pay a fee. If it is not something simple, it's often riddled with errors or takes a huge numbers of prompts to get it right. So some time was saved in typing, but then lost in code review and fixing errors. Humans that can understand what they are doing, troubleshoot, and architect are still needed.


Shady people is one thing, marketing a language with impossible claims is another.

People got interested in the language over wildl claims that are simply CS-wise impossible. Later, these were removed from the site and you are left with a.. not too interesting language. I'm judging it on this late phase, with a bad taste in my mouth from the former shenanigans.

> in 6 months as code will be increasingly written by machines

Come on..


Py2many is a great project. There are actually a couple of Python to Vlang (Py2V) projects.


One thing with python is that usually I will use one of the many c based libraries to get reasonable speed and well thought out abstractions from the start. I architect around numpy, scipy, shapely, pandas/polars or whatever. So my code runs at reasonable speed from the start. But transpiling to rust then effectively means a complete redesign of the code, data structures, algorithms etc. And I have seen the AI tools really struggle to get it right, as my intent gets lost somewhere.

So what I do now (since Claude Code) is write really bare bones (and slow) pure python implementation (like I used to do for numba, pypy or cython ready code), with minimal dependencies. Then I use the REPL, notebooks and nice plotting tools to get a real understanding of the problem space and the intricacies of my algorithm/problem at hand. When done, I let Claude add tests and I ask it to transpile to equivalent Rust and boom! a flawless 1000x speed upgrade in a minutes.

The great thing is I don't need to do the mental gymnastics to vectorize code in a write only mode like I've had to do since my Matlab days. Instead I can write simple to read for loops that follow my intent much better, and result in much more legible code. So refreshing!

And with pyO3 i can still expose the Rust lib to python, and continue to use Python for glue and plotting


Cython and all the libs you mention use the c-api, which is the #1 thing python needs to lose to be competitive.

I wish someone writes a stdlib without using it. My attempt from a few months ago in a repo under the py2many org.


> Cython and all the libs you mention use the c-api, which is the #1 thing python needs to lose to be competitive.

Quite hard to lose the #1 reason people use the language for.


The #1 reason people use it is because it allows you to focus on the problem you're solving rather than the syntax, memory management or some other aspect.

Most people don't even know what C-API is or why it slows things down.

Compatibility is made into a bigger deal than it is. That's the COBOL argument.

I wish the python community focused more on why openclaw and opencode are getting written in typescript, not python.

Why aren't agents more efficient at translating python code into shippable end user binaries using fast interpreted -> compiled agentic loops and attempt memory safety only for binaries/libraries with a large distribution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: