Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Laya the open source version of Jev(convaiinnovations.com ↗)
    37comments
  2. AI-generated posters don’t have to be horrible(john.hartnup.uk ↗)
    311comments
  3. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    150comments
  4. “The Secret Life of Circuits” is here(coredump.cx ↗)
    31comments
  5. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    506comments
  6. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    109comments
  7. What Zig felt like, coming from Rust(besok.github.io ↗)
    discuss
  8. San Francisco Onion Futures Company(onionfutures.com ↗)
    89comments
  9. Tin: full-text search for Postgres(planetscale.com ↗)
    discuss
  10. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    1comments
  11. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    147comments
  12. Communication by means of modulated Johnson noise(pnas.org ↗)
    15comments
  13. From Stonemasons to Carpenters(thelastsoftwareengineer.substack.com ↗)
    4comments
  14. Cloudflare Quick Tunnels(cloudflare.com ↗)
    296comments
  15. How to Write with an LLM(sockpuppet.org ↗)
    354comments
  16. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    22comments
  17. SDCC – Small Device C Compiler(sourceforge.net ↗)
    21comments
  18. Saving another 100TB of RAM(cloudflare.com ↗)
    86comments
  19. Science Is Open Software(jepedersen.dk ↗)
    46comments
  20. Ray Ozzie and the Optimism of Being Early(reproof.app ↗)
    4comments
  21. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    42comments
  22. NASA-IBM Lunar Foundation open-Source Geospatial AI Model(usra.edu ↗)
    5comments
  23. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    6comments
  24. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    107comments
  25. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    114comments
  26. OpenJev(openjev.com ↗)
    274comments
  27. Goroutine Leak Profiles(go.dev ↗)
    6comments
  28. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    89comments
  29. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    76comments
  30. Show HN: I wrote a custom assembler for CHIP-8 in C++(github.com/tackx ↗)
    4comments

Customasm – An assembler for custom, user-defined instruction sets

73 pointsby 1y agogithub.com
17 comments
1y agoHN ↗

This is very cool! I'm always on the lookout for extensible assemblers. I especially want one that can handle a normalized subset of GNU assembly so that it can be used on the output of LLVM or GCC (using existing assembly languages, but assembling them in non-standard ways or with extensions).

1y agoHN ↗

flat assembler g (fasmg) does this. It has a powerful macro language, in which, among other architectures and formats, it implements x86 and ELF/PE/macho and is able to assemble itself.

I like to use it for scripting for turning binary formats to text and vice-versa.

1y agoHN ↗

This is very cool. On the topic of assembly, does anyone know of a language that is higher level than assembly, but retains the property that the output doesn't depend on the compiler or its flags?

I want it for low level CPU benchmarks and tests. Using C or assembly for those both suck.

I don't really know exactly how this would look (is the register allocator part of the spec?) but has anyone tried something like this?

1y agoHN ↗

but retains the property that the output doesn't depend on the compiler or its flags?

That's not an inherent property of assemblers, and not the case in practice either.

1y agoHN ↗

Yes I know there are some minor caveats with pseudo-instructions and relocations but in general it is basically true. You can't wildly change the output without changing the source like you can with C.

1y agoHN ↗

Have you tried looking into something like NASM's macro functionality?

1y agoHN ↗

That sounds like a tall order. If you want it for CPU benchmarks, you presumably want to be able to use all real CPU machine instructions. Or a simpler language instruction set but with an optimizer, but it's hard to write an optimizer and then you could never change the optimizer.

1y agoHN ↗

There was a post on HN where someone implemented a new language compiler purely from Assembly, and shows you from nothing to the very end where it looked mostly like a LISP assembly language. It was really neat. Sadly I dont have the buzzwords for Google to find it anymore, used to be able to find the powerpoint slides for it.

I forgot about HLA (High Level Assembly) though I have not used it personally, there were also a few others like C-- as well:

https://en.wikipedia.org/wiki/High_Level_Assembly

1y agoHN ↗

My complements on this. Assembler is the ultimate understanding and control.

1y agoHN ↗

Interesting. If only it supported little-endian architectures!