Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Laya the open source version of Jev(convaiinnovations.com ↗)
    142comments
  2. A graphical desktop for the ZX Spectrum(github.com/mindbox77 ↗)
    49comments
  3. Tin: full-text search for Postgres(planetscale.com ↗)
    42comments
  4. AI-generated posters don’t have to be horrible(john.hartnup.uk ↗)
    458comments
  5. Human brain is two separate organs, Stanford Medicine-led research finds(stanford.edu ↗)
    180comments
  6. Supabase (YC S20) Is Hiring for OrioleDB(supabase.link ↗)
    discuss
  7. Asking Authors About Their Own Papers(medium.com/tmlrorg ↗)
    36comments
  8. “The Secret Life of Circuits” is here(coredump.cx ↗)
    51comments
  9. Black Holes or Black Hole Stars? Astronomers Spar over 'Little Red Dots'(quantamagazine.org ↗)
    13comments
  10. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    552comments
  11. I built the fastest PHP webserver in the world(qbixserver.com ↗)
    28comments
  12. San Francisco Onion Futures Company(onionfutures.com ↗)
    117comments
  13. New evidence for hidden chambers beyond Tutankhamun's tomb(nature.com ↗)
    5comments
  14. GPT-6 Astra Solves a WWI German Radio Cipher(prinzai.com ↗)
    132comments
  15. If math is more than proof, we need to better celebrate the rest of it(terrytao.wordpress.com ↗)
    192comments
  16. Agreement between the USA and Denmark (1951,2004) [pdf](state.gov ↗)
    14comments
  17. What Zig felt like, coming from Rust(besok.github.io ↗)
    108comments
  18. Cloudflare Quick Tunnels(cloudflare.com ↗)
    301comments
  19. How to Write with an LLM(sockpuppet.org ↗)
    360comments
  20. You can run Git on object storage if you re-make packfiles(tigrisdata.com ↗)
    24comments
  21. Communication by means of modulated Johnson noise(pnas.org ↗)
    18comments
  22. Saving another 100TB of RAM(cloudflare.com ↗)
    89comments
  23. SDCC – Small Device C Compiler(sourceforge.net ↗)
    23comments
  24. Ray Ozzie and the Optimism of Being Early(reproof.app ↗)
    11comments
  25. Science Is Open Software(jepedersen.dk ↗)
    51comments
  26. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    44comments
  27. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    122comments
  28. Ctenophores: Wonders of Biology(quantamagazine.org ↗)
    7comments
  29. OpenJev(openjev.com ↗)
    280comments
  30. From Stonemasons to Carpenters(thelastsoftwareengineer.substack.com ↗)
    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!