Hacker Newsnew | past | comments | ask | show | jobs | submit | Hasnep's commentslogin

I bounced off OCaml a few years ago because of the state of the tooling, despite it being almost exactly the language I was looking for. I'm really happy with Gleam now, and recommended it over OCaml for most use cases.

Did you consider using F#? The language is very similar to OCaml, but it has the added benefit of good tooling and a large package ecosystem (can use any .NET package).

I always assumed a runtime specialized for highly concurrent, fault-tolerant, long-running processes would have a noticeable startup penalty, which is one of the things that bothers me about Python. Is that something you notice with Gleam?

I tried out Gleam for Advent of Code this year. There was a significant difference in startup times, about 13 ms for Python and 120 ms for Gleam.

If you want something with minimal startup times then you need a language that complies to native binaries like Zig, Rust or OCaml.


Can you use Gleam for ad-hoc scripting? In my mind that means two requirements that most languages fail at.

1. You can import by relative file path. (Python can't.)

2. You can specify third party dependencies in a single file script and have that work properly with IDEs.

Deno is the best option I've found that has both of those and is statically typed.

I'm hoping Rust will eventually too but it's going to be at least a year or two.


Cosmic desktop shipped in PopOS 24.04 a few weeks ago btw

Nice, I missed that!

It seems like your main gripe is that writing the type annotations slows you down, so I'd be interested to know what you think of languages like OCaml, Elm, Gleam or Roc. These are languages which never (or almost never) require any type annotations because the compiler can always infer all the types. Most people using these languages tend to add type annotations to top-level functions anyway though.

It seems to me that this is equivalent to a language without a type checker that automatically generates a unit test for every line of your program that tests its type.


Yes, SQL is a query language and clickhouse is a database that uses SQL as a query language, but I don't see why that's relevant.

Oh, this would have been great for a project I was working on a while ago! I'll have to keep it in mind for the future. Thanks for sharing

The author is also the creator of the textual Python library for creating TUIs. The performance benefits of Rust don't seem very useful in a tool where you spend a few seconds typing in a prompt and then 90% of your time is spent waiting. As long as the UI is responsive when typing there wouldn't be much of a difference.

Didn’t know that. Good reason then of course. But I do notice these sort of differences. Codex feels way better than Claude code to me for example.

I tried Toad and to me it feels ridiculously slow and laggy. Switching between input and output (ALT+up/down) for example just lags, I can notice the transition. The whole UI lags. It's no wonder, it's python. Simply the wrong language for this, sorry.


Yeah it feels slow and laggy to me too and I'm not on an old laptop. Running on a M3 Macbook Pro here. I definitely notice the difference between using something like Ghostty (Rust based - super fast) and Toad (Python).

It doesn't really make sense to compare the performance of Ghostty, a terminal emulator, with Toad, a TUI. Also Ghostty is written in Zig, not Rust.

It's obviously way slower though. Also the point stands, it's written in a low-level, performance-oriented language. The author of Toad could have written it in Rust, Zig, C++, etc, but chose Python instead. He valued ease of development versus performance and the result is we get a laggy terminal.

I know for a fact that Textual can generate an entire frame in less than a 60th of a second. Any lag you see has nothing to do with the choice of language. A TUI just doesn’t require that much number crunching to use a low level language.

I’d be interesting in knowing what platform and terminal you observed the lag, when testing Toad.


It is quite literally instantaneous on my 5 year old laptop. Whatever you are seeing isn't due to the choice of Python.

Maybe it's something on my setup then. I notice some delay even though it's by no means huge but noticable. For me these things add up, another example is pane resizing in tmux. I like things snappy, but it's kind of an OCD thing I guess.

Oh, this is the reason the Mullvad app on my Pixel 6a was suddenly able to connect in less than a second where before it would take 5-10 seconds, nice!

I didn't enjoy using JJ for the first day or two until I discovered jjui, now I do probably 95% of my interactions with jj through jjui.


Jjui is incredible. I keep shouting it from every rooftop that I find. So good, in fact, that I'd argue it should be made an official TUI


@nchmy You’re probably the biggest evangelist I’ve ever met.


That somehow feels like an insult!

Keep up the great work


This sounds like the kind of situation where the LSP could suggest the simpler code, I'll see if there's an issue for it already and suggest it if not.


Elixir has one opinionated formatter -- Quokka -- that will rewrite the code above properly. It can also reuse linting rules as rewrite policies. Love using it.


You kinda did...

> By accepting this agreement and using the software you agree that Microsoft may collect, use, and disclose the information as described in the Microsoft Privacy Statement [...]

Doesn't make it okay, just legal

https://www.microsoft.com/content/dam/microsoft/usetm/docume...


There's a couple of terms in contract law, like fairness of obligations, unconscionability, disproportionate penalty, excessive advantage, etc. that the US seems to have forgotten. In the EU and other countries such... aberrations are struck down and unenforceable. People are still scared silly, but the ones that protest are usually left alone.


Those aspects of contract law mean that if MS included "you owe us your first born child" or "if you have not uninstalled this operating system within 2 weeks of installation, you owe Microsoft an additional one million dollars" then that clause wouldn't be valid.

They don't however mean that MS choosing to put adverts all over Windows is illegal, or a breach of the contract, just because users would prefer the OS be ad-free. The EU could legislate in various ways that would mean MS had to stop doing so, but they haven't yet and there's no aspect of general contracts law currently that prevents it.


Many countries have laws against "hidden defects".

One could argue that adding ads after some time from a system putchased without ads throuh updates is a defect that has been hidden at purchase time.


One could argue that, and like I just wrote in my reply to your sibing comment (https://news.ycombinator.com/item?id=46087142) I would agree with you with regards to ethics, but it's not a valid argument from an actual legal perspective.

I'd love to be proven wrong about this, because I'm not blowing smoke up your ass I really do agree with you in that I wish MS could and would be sued over this, and lose, and have to stop making Windows shit like this. But I'm fairly confident that the only possibility would be for EU (or individual nations) to write new legislation addressing it.


If you bought and paid something (not a subscription) that was ad-free and then all of a sudden in a mandatory update you start to get ads, well, maybe someone already tried and failed to sue MS but personally seems pretty predatory.


From an ethical point of view I completely agree that it's predatory, I just don't believe any EU laws exist that mean anyone would have a chance of success trying to sue over that, I don't believe it to be illegal. And while I'm not all-knowing, nor am I someone who knows every single relevant law like the back of my hand, my opinion is somewhat backed up by the fact that I'm not aware of anyone with actual legal knowledge having ever suggested this behaviour of Microsoft's could be considered illegal the way you want it to be, it's only ever people who are users who think it should be considered breach of contract. (And considering how much money it would be worth if you could sue MS for this and win, if it were even a 50/50 question you'd get lawyers trying.)


A good chunk of EULAs are partially-completely unenforceable in US contract law as well.

It just doesn’t stop corporations from using them as a scare tactic.


Your fault for not letting your drink at the bar get chemically analyzed before drinking it


Doesn't necessarily make it legal either, but proving that in court would require pitting your own wallet against Microsoft's.


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

Search: