HNHacker News
TopNewBestAskShowJobs

greener_grass

319 karma · joined August 5, 2024

submissionscomments
greener_grass··on SPy: An interpreter and compiler for a fast statically typed variant of Python
This is what F# provides.

F# has a similar whitespace syntax to Python, but is statically typed and can be compiled AoT.

Bubble sort Python:

    mylist = [64, 34, 25, 12, 22, 11, 90, 5]

    n = len(mylist)
    for i in range(n-1):
      for j in range(n-i-1):
        if mylist[j] > mylist[j+1]:
          mylist[j], mylist[j+1] = mylist[j+1], mylist[j]

    print(mylist)


Bubble sort F#:

    let mylist = ResizeArray [ 64; 34; 25; 12; 22; 11; 90; 5 ]

    let n = Seq.length mylist
    for i = 0 to n - 2 do
      for j = 0 to n - i - 2 do
        if mylist[j] > mylist[j + 1] then
          let temp = mylist[j]
          mylist[j] <- mylist[j + 1]
          mylist[j + 1] <- temp

    printfn "%A" mylist
greener_grass··on Hypothesis: Property-Based Testing for Python
Decorators are just function application with more syntax.
greener_grass··on Result is all I need
Result is great but it ideally needs extensible union types (polymorphic variants) plus exhaustive pattern matching to work well.
greener_grass··on UIs Are Not Pure Functions of the Model – React.js and Cocoa Side by Side (2018)
It exists, but as a Haskell library called Reflex. This is why it didn't gain traction ;)
greener_grass··on AI is making us work more
It does just seem to be "down".

But such is that state of the UK that I had simply assumed the government had censored it. Remarkable how quickly expectations have shifted.

greener_grass··on A critique of package managers
If we depend on less then we are capping what we can build to only what we can write and manually integrate. This is dis-empowering.
greener_grass··on Creative Technology: The Sound Blaster
In an alternate reality maybe Creative went from Audio cards to MP3 players to Smartphones and GPUs
greener_grass··on Improvements to OCaml code editing: the basics of a refactor engine
LLM generated variable names would be nice!
greener_grass··on AI coding agents are removing programming language barriers
More people who are not traditionally programmers are now writing code with AI assistance (great!) but this crowd seems unlikely to pick up Clojure, Haskell, OCaml etc... so I agree this is a development in favor of mainstream languages.
greener_grass··on Blip: Peer-to-peer massive file sharing
Is this AirDrop but cross-platform?
greener_grass··on Losing language features: some stories about disjoint unions
The designer of the type must manually ensure exhaustive checking but then consumers will be forced to do exhaustive matching.

It's not that bad in practice.

greener_grass··on I'm Switching to Python and Actually Liking It
I love this sentiment:

> There should be one-- and preferably only one --obvious way to do it.

But I often don't think the Pythonic way is a very good way to do it. And this leaves you a bit stuck!

greener_grass··on Switching Pip to Uv in a Dockerized Flask / Django App
Does `pip-compile` solve deps and transitive deps?

I thought it only locks down hashes?

greener_grass··on Switching Pip to Uv in a Dockerized Flask / Django App
If you write out `requirements.txt` by hand, do you also need to resolve deps and transitive deps by hand?

This is what pushed me to use Poetry.

greener_grass··on Of Course ML Has Monads (2011)
Does ML have do notation?

In ML do you need to write `List.map` where in Haskell you can write `map` and it infers the type?

greener_grass··on Switching Pip to Uv in a Dockerized Flask / Django App
UV looks very promising but I can assure you, if everyone adopted it tomorrow we would see a long tail of scenarios that UV does not work well for.
greener_grass··on Switching Pip to Uv in a Dockerized Flask / Django App
Rust offers a feature-set that neither Python nor C has. If Rust is the right tool for the job, I would rather the code be written in Rust. Support has more to do with incentive structures than implementation language.
greener_grass··on Guess I'm a Rationalist Now
I suggest teaching them about the Problem of Induction [1].

Scientific thinking is not the same as mathematical thinking and it becomes quite wishy washy grey if you zoom in too far!

[1] https://plato.stanford.edu/entries/induction-problem/

greener_grass··on Guess I'm a rationalist now
I think there is an arbitrage going on where STEM types who lack background in philosophy, literature, history are super impressed by basic ideas from those subjects being presented to them by stealth.

Not saying this is you, but these topics have been discussed for thousands of years, so it should at least be surprising that Yudkowsky is breaking new ground.

greener_grass··on Guess I'm a rationalist now
For any speed-runners out there: https://en.wikipedia.org/wiki/Two_Dogmas_of_Empiricism
greener_grass··on Guess I'm a rationalist now
There was always an underlying Randian impulse to the EA crowd - as if we could solve any issue if we just get the right minds onto tackling the problem. The black-and-white thinking, group think, hero worship and charicaturist literature are all there.
greener_grass··on Darklang Goes Open Source
Do you think Unison will suffer the same fate?
greener_grass··on Darklang Goes Open Source
Mojo's promise is the same code, but faster.

They were planning some language extensions but it's more like a compiler project than a programming language project.

The truth is, most developers don't want to learn a new language.

They will jump through extra hoops just to use their favorite one (e.g. Airflow).

Successful languages appear when there is an extreme market demand (C++ providing OOP over C) or, more commonly, a hot new platform that people want to get in on (JavaScript, Swift, Kotlin, C#, ...)

For most people, new syntax / semantics is considered a negative and there needs to be some massive upside to overcome that.

greener_grass··on OxCaml - a set of extensions to the OCaml programming language.
OxCaml takes a different approach to encoding locality to Rust. Rust (arguably) overburdens the type-system with this information whilst in OxCaml this is orthogonal to the return types. In that sense it's a bit like algebraic effects. Personally I'm quite bullish on OCaml these days.
greener_grass··on Show HN: S3mini – Tiny and fast S3-compatible client, no-deps, edge-ready
- NPM could migrate to reproducible builds of artefacts

- Trust could be opt-in by default

- Dependency installation could be made fully reproducible

greener_grass··on Show HN: S3mini – Tiny and fast S3-compatible client, no-deps, edge-ready
So let's put every package under the sun into the client?

This approach does not scale. We should make NPM better.

greener_grass··on Show HN: S3mini – Tiny and fast S3-compatible client, no-deps, edge-ready
The S3 packages on NPM are maintained by AWS
greener_grass··on Show HN: S3mini – Tiny and fast S3-compatible client, no-deps, edge-ready
Can someone explain the advantage of this?

If I want S3 access, I can just use NPM

If I don't want S3 access, I don't want it integrated into my runtime

greener_grass··on Zed: High-performance AI Code Editor
Huh, Richard Feldman of Roc and Elm fame!
greener_grass··on OCaml's Wings for Machine Learning
A small community but some things going on:

- https://github.com/dotnet/TorchSharp

- https://github.com/DiffSharp/DiffSharp

- https://github.com/fsprojects/Furnace

- https://github.com/plotly/Plotly.NET

← PreviousPage 2 of 5Next →