HNHacker News
TopNewBestAskShowJobs

greener_grass

319 karma · joined August 5, 2024

submissionscomments
greener_grass··on The age of average (2023)
A good "survey" of something that has been observed many times before. I'm not sure it adds any new insights, however.
greener_grass··on Just Say No to JavaScript
JavaScript is a very capable language. It has better functional programming support than Java and Python. It has fewer footguns that C++. You can start with a scrappy prototype then gradually add type-checking later. Of the mainstream languages, it's actually one of the better ones!
greener_grass··on Functional Programming Self-Affirmations
You need the syntax if you want it to actually work well in practice.
greener_grass··on Functional Programming Self-Affirmations
Haskell has do-notation which is a more general kind of this syntactic sugar
greener_grass··on Functional Programming Self-Affirmations
> Is immutability exclusive to functional programming?

No, but immutable defaults are powerful.

E.g. in JavaScript / Python, the built-in lists and dictionarys (which are blessed with special syntax) are mutable.

> Is the ability to use data/values exclusive to functional programming?

No, but expression-orientation makes this less painful

> Are monads exclusive to functional programming?

You can hack them in by abusing co-routines or perhaps async/await in various languages, but it will never be as good as something built for this purpose.

Type-inferences, type-classes and do-notation make monads workable in practice.

greener_grass··on Functional Programming Self-Affirmations
Then you end up with a pyramid of doom. Fine for small examples but it doesn't scale up easily.

Rust has special syntax (`?`) for this AFAICT.

greener_grass··on Functional Programming Self-Affirmations
I'm not convinced that you can follow all of these outside of Functional Programming.

How can you "Make illegal states unrepresentable" with mutable state and sequences of mutations that cannot be enforced with the type system?

How can you do "Errors as values" at a large scale without do-notation / monads?

How can you do "Functional core, imperative shell" without the ability to create mini DSLs and interpreters in your language?

greener_grass··on OCaml Syntax Sucks (2016)
I've always liked this - it follows the structure of a good academic essay
greener_grass··on A common urban intersection in the Netherlands (2018)
But once upon a time the UK had higher cycling rates than the Netherlands.

How did the Netherlands manage to overcome this back in the 70s and the UK has not?

greener_grass··on Show HN: Bike route planner that follows almost only official bike trails
A great concept, but there's one big problem: many official bike trails are crap.

Sometimes it's actually better to take the road, or you end up on a windy route that's near impossible to follow, debris everywhere, no right of way, etc.

I would like to try this with a "prefer offroad" option.

greener_grass··on Yi Peng 3 crossed both cables C-Lion 1 and BSC at times matching when they broke
So if Trump is against China, and China aligns with Russia, will Trump then support Ukraine? Interesting (and choppy) times ahead.
greener_grass··on Ask HN: Is Object Orientated Programming Over?
They are both imperative / data-orientated languages and Rust has light functional programming.
greener_grass··on Ford to Halt F-150 Lightning Production as EV Demand Wanes
Why is it so expensive?

Is it cost of production being passed on or did the marketing department decide to do some "prestige" pricing?

greener_grass··on A comparison of Rust’s borrow checker to the one in C#
> not viable for games

> Unity devs run into

So it's viable but not perfect

greener_grass··on SSH Remoting
I wonder if image based screen sharing (e.g. Google Meet) is the "worse is better" here?

Zed collaboration sounds great, but what about all of the other apps I use?

Image based sharing supports everything (poorly) automatically.

greener_grass··on Net 9.0 LINQ Performance Improvements
A bit of the beaten path, but F# with Fable is a very powerful combination.

On the server you can run ASP.Net using Giraffe, which is a Functional Programming layer with comparable performance to C#.

On the front-end, you can write React in an true Functional Programming language.

And of course you can share F# code between frontend and backend.

greener_grass··on Why don't we use awnings anymore (2022)
The Netherlands seems like the most sensible country on earth. How did they manage it?
greener_grass··on Rama on Clojure's terms, and the magic of continuation-passing style
CPS might be the underlying structure, but that doesn't mean that CPS is the interface.
greener_grass··on Game Programming in Prolog
Is there a variant of Prolog that is less dynamic with AoT compilation?

Imagine if you can be in "dynamic mode" where you can add rules, facts, etc. in an adhoc way.

Then, once your game is better defined, you can compile the Prolog to native code so that it is highly optimized, executed in parallel, etc. The compiler could apply all sorts of optimizations we see in commercial game engines automatically.

This compiled object could then be embedded into a game engine with native performance.

Done right, this could even outperform imperative game engines, but be very easy to debug and modify.

greener_grass··on Zod: TypeScript-first schema validation with static type inference
Some tech influencers pushed Zod - that's basically the entire story
greener_grass··on European govt air-gapped systems breached using custom malware
Why would you need A/V on an air-gapped system?
greener_grass··on Serialization Is the Secret
1. Structural sharing - most data doesn't change so you create a copy that reuses much of the original structure

2. Garbage collection and lexical scopes - you clean up memory quickly and in batch

3. Compiler optimizations - you turn functional constructs into imperative ones that reuse and mutate memory at compile-time, where it is provably safe to do so

Roc Lang might interest you: https://www.youtube.com/watch?v=vzfy4EKwG_Y

greener_grass··on Multiversion Python Thoughts
This is Rich Hickey's suggestion too

https://www.youtube.com/watch?v=oyLBGkS5ICk

greener_grass··on Mira Murati leaves OpenAI
AI safety people claiming that working on AI start-ups is a good way to prevent harmful AI is laughable.

The second you hit some kind of breakthrough, capital finds a way to remove any and all guardrails that might impede future profits.

It happened at DeepMind, Google, Microsoft and OpenAI. Why won't this happen the next time?

And ironically, many in this community say that corporations are AI.

greener_grass··on Orion, our first true augmented reality glasses
And those don't have mass adoption. If Meta wants this kind of device to sell well, they need to distance themselves from them.
greener_grass··on Orion, our first true augmented reality glasses
Glasses that offer you an AR experience / HUD?

Pretty cool

Glasses that let you record people without their awareness / consent?

Downright creepy

I think the best play here would be to release them without any camera functionality at all, or the connotations will be that weird, sweaty guy that no one wants to sit next to on the subway (see: Google Glass).

greener_grass··on Love of cargo bikes is changing how we deliver goods in our cities
Cost models are completely different too.

Bikes have very low maintenance costs and if you buy second hand you don't lose much on resale.

greener_grass··on Microsoft TypeSpec
TypeScript wasn't better than Flow when it gained dominance. It happened because Microsoft created an out-of-the-box experience with VS Code that worked great with TypeScript but made Flow types look broken.
greener_grass··on Zb: An Early-Stage Build System
I'm excited by this!

Quick question: if the build graph can be dynamic (I think they call it monadic in the paper), then does it become impossible to reason about the build statically? I think this is why Bazel has a static graph and why it scales so well.

greener_grass··on Rio: Web apps in pure Python
> Aside from the definition itself not being usable inline, there is nothing lambda does that def doesn't

Being unable to position it inline is the problem.

You might not see the benefit, but many do. It prevents Python from being a good functional programming, for one thing.

← PreviousPage 4 of 5Next →