frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

"high level" languages are easier to optimize

https://jyn.dev/high-level-languages-are-easier-to-optimize/
9•zdw•4h ago

Comments

wavemode•3h ago
High level languages are easier to optimize because they are starting with more de-optimizations. Haskell can be optimized to perform stream operations on unboxed integers, precisely because integers are boxed to start with! Whereas the code you would have written in C to do the same thing would already be using unboxed integers, no?
gizmo686•2h ago
Sometimes. Other times you write inneficient C because it makes the code simpler.
Athas•1h ago
The greatest value brought by compiler optimisations is removing the overhead of convenience. Sometimes that is about avoiding the boxing that is a necessity in many high level languages, but in other cases it serves to allow a more modular programming style without overhead. Stream fusion is a good example: it lets you structure your program as small and composable units, without the cost of manifesting intermediate results. That is not merely about avoiding the inherent inefficiency of e.g. Haskell, but about permitting different styles of programming, and the argument is that a low level language simply cannot allow such a style (without overhead), because the required optimisations are not practical to implement.
jynelson•58m ago
you can imagine a version of Haskell that doesn’t have polymorphism or laziness, that only has unboxed integers, and as a result doesn’t need a GC. in such a language it’s still easy for the compiler to do stream fusion; whereas it’s still hard in C because the compiler needs to prove the loop doesn’t have side effects.
AlotOfReading•3h ago
The argument isn't wrong and people have been making it for decades that everything from Java to standard ML should be theoretically faster than C. I think it's telling that despite that, the comparison the author chose is a functional language running in parallel (after compiling to C) vs single threaded C. That comparison is obviously nonsense.

The argument is wrong because the best optimizer is the stuff between your ears, not a compiler. C and to a lesser extent C++ have always won because they allow you to spend those neurons thinking about the underlying machine with a thin(ner) abstraction layer instead of wrapping it in layers of conceptually elegant abstractions that get dissected by a sufficiently smart compiler.

api•2h ago
Is there any work trying to apply transformers to compiler optimization? Seems like we have some new tools to potentially make compilers even better.

But yes, humans can still usually optimize better.

The other thing you see with high level languages is a death by a thousand cuts due to things like cache locality or instruction level parallelism. It’s very, very hard to write a VM with stuff going on like JIT and GC and a heap allocator that gives you good locality or ILP. A major problem is that yes you can optimize for that, including in real time, but that not only adds work but adds work that implies a cache flush.

The latter point — cache locality and ILP — is why some C/C++/Rust code is faster when compiled optimizing for space instead of for “speed.” Less code means it fits in cache.

All that being said, HLLs usually offer superior programmer productivity, especially for novice to mid career devs who aren’t quite up to things like comprehending the Rust borrow checker. Machine time has to be weighed against human time. The latter is usually more expensive (but not always at scale!).

jynelson•45m ago
when’s the last time you wrote a parallel array traversal in C?

also, consider reading the linked post about how assembly instructions are no longer a good approximation of how your computer works: https://queue.acm.org/detail.cfm?id=3212479. in general, writing in a language that is not close to the hardware allows the compiler to adapt when the hardware changes; for example futhark has the ability to execute using either SIMD or GPUs precisely because it’s not over-determined by the source language. C ties processors to the model of the PDP-11, which hasn’t been manufactured for 30 years.

rurban•2h ago
Typed languages are even more easier to optimize. No need for the box/unboxing dance and escape analysis

Ask HN: How do you get first 10 customers?

1•jcofai•8m ago•0 comments

Nodegram

https://nodegram.org/
2•SaintCrystal•11m ago•0 comments

I don't care what the code looks like anymore

https://substack.com/inbox/post/168163753
3•growbell_social•12m ago•0 comments

Coordinating tasks between humans and Claude Code Agents using Leantime

https://leantime.io/hybrid-teams-ai-developers-leantime-mcp/
1•mfolaron•14m ago•0 comments

Collatz's Tape

https://gbragafibra.github.io/2025/07/12/collatz_ant8.html
1•Fibra•18m ago•0 comments

Microsoft enables opt-out telemetry in Go 1.25

https://devblogs.microsoft.com/go/microsoft-go-telemetry/
5•orphea•25m ago•1 comments

Killer whales appear to craft their own tools

https://www.economist.com/science-and-technology/2025/06/23/killer-whales-appear-to-craft-their-own-tools
3•bookofjoe•26m ago•1 comments

The Streaming Wars Come Down to 2: YouTube vs. Netflix

https://www.nytimes.com/2025/07/12/business/media/youtube-netflix-streaming.html
1•ripe•26m ago•0 comments

'Starter packs' have played a central role in Bluesky's rapid growth

https://www.tu-darmstadt.de/universitaet/aktuelles_meldungen/einzelansicht_512064.en.jsp
4•FinnKuhn•26m ago•1 comments

What Is Vibe Coding?

https://cloud.google.com/discover/what-is-vibe-coding
2•taubek•27m ago•1 comments

I Messed Up My Google PM Vibe Coding Interview

https://old.reddit.com/r/ProductManagement/comments/1lw9r9h/i_messed_up_my_google_pm_vibe_coding_interview/
2•taubek•28m ago•0 comments

Trump, Epstein and the Deep State

https://chrishedges.substack.com/p/trump-epstein-and-the-deep-state
4•chmaynard•36m ago•0 comments

How to Detect Text Truncation in SwiftUI?

https://fatbobman.com/en/posts/how-to-detect-text-truncation-in-swiftui/
1•prognu•40m ago•0 comments

Bypassing Google's big anti-adblock update

https://0x44.xyz/blog/web-request-blocking/
27•deryilz•43m ago•6 comments

Uncertainty Is an Evocative State

https://www.startingfromnix.com/p/uncertainty-is-an-evocative-state
1•jger15•47m ago•1 comments

Outer Joining with ANSI SQL-89 and SQL-92

https://www.salvis.com/blog/2025/07/12/outer-joining-with-ansi-sql-89-and-sql-92/
1•tanelpoder•50m ago•0 comments

How Living in San Francisco Made Me More Present

https://aginfer.bearblog.dev/sanfrancisco-present/
1•agcat•54m ago•0 comments

Ultrastable optical frequency transfer and attosecond timing in multicore fiber

https://opg.optica.org/optica/fulltext.cfm?uri=optica-12-6-894&id=573120
1•PaulHoule•57m ago•0 comments

India's richest man wants to turn every TV into a PC

https://techcrunch.com/2025/07/11/indias-richest-man-wants-to-turn-every-tv-into-a-pc/
1•rntn•57m ago•2 comments

Mark Zuckerberg on rebranding Facebook (2018)

https://twitter.com/TechEmails/status/1944105758297403604
1•mfiguiere•57m ago•0 comments

The Myth of the Papal Toilet Chair

https://daily.jstor.org/the-myth-of-the-papal-toilet-chair/
2•Anon84•58m ago•0 comments

Lstarks

1•lstarks•1h ago•0 comments

Show HN: An educational Local Qwen3 LLM Inference project written in Rust

https://github.com/reinterpretcat/qwen3-rs
3•eiskalt•1h ago•1 comments

Tissue-integrated bionic knee restores versatile legged movement post amputation

https://www.science.org/doi/10.1126/science.adv3223
3•gnabgib•1h ago•0 comments

Deepest Infrared Image of Universe Yet

https://www.nasa.gov/image-article/nasas-webb-delivers-deepest-infrared-image-of-universe-yet/
2•busymom0•1h ago•1 comments

Federal Employees and Contractors Oral History Project

https://www.oah.org/2025/03/04/federal-employees-oral-history-project/
3•ohjeez•1h ago•0 comments

Claude Opus Analysis of Twitter's 2023 ML Algorithm

https://github.com/twitter/the-algorithm-ml/pull/493
1•Olshansky•1h ago•0 comments

Show HN: BorgLLM, Zero-config LangChain Client, key rotation and rate limit mgmt

https://borgllm.com
1•omneity•1h ago•1 comments

Tuva or Bust!

https://en.wikipedia.org/wiki/Tuva_or_Bust!
1•layer8•1h ago•0 comments

What Fred Smith Did

https://www.marclevinson.net/?p=2477
2•ajd555•1h ago•1 comments