frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

The Sail instruction-set semantics specification language

https://alasdair.github.io/manual.html
25•weinzierl•9h ago

Comments

timhh•8h ago
I've used this a lot via the RISC-V Sail model: https://github.com/riscv/sail-riscv

It's a really nice language - especially the lightweight dependent types. Basically it has dependent types for integers and bit-vector lengths so you can have some really nice guarantees. E.g. in this example https://github.com/Timmmm/sail_demo/blob/master/src/079_page... we have this function type

  val splitAccessWidths : forall 'w, 0 <= 'w . (xlenbits, int('w)) ->
    {'w0 'w1, 'w0 >= 0 & 'w1 >= 0 & 'w0 + 'w1 == 'w . (int('w0), int('w1))}
Which basically means it returns a tuple of 2 integers, and they must sum to the input integer. The type system knows this. Then when we do this:

  let (width0, width1) = splitAccessWidths(vaddr, width);
  let val0 = mem_read_contiguous(paddr0, width0);
  let val1 = mem_read_contiguous(paddr1, width1);
  val1 @ val0
The type system knows that `length(val0) + length(val1) == width`. When you concatenate them (@ is bit-vector concatenation; wouldn't have been my choice but it's heavily OCaml-inspired), the type system knows `length(val1 @ val0) == width`.

If you make a mistake and do `val1 @ val1` for example you'll get a type error.

A simpler example is https://github.com/Timmmm/sail_demo/blob/master/src/070_fanc...

The type `val count_ones : forall 'n, 'n >= 0. (bits('n)) -> range(0, 'n)` means that it's generic over any length of bit vector and the return type is an integer from 0 to the length of the bit vector.

I added it to Godbolt (slightly old version though) so you can try it out there.

It's not a general purpose language so it's really only useful for modelling hardware.

Y_Y•7h ago
I see the RISC-V Sail repo mentions compiling to SystemVerilog. That would be amazing, if you could specify instruction semantics and have that transformed all the way into silicon.
timhh•7h ago
It's still kind of experimental. Also the purpose is more for formal verification against a real design. The RISC-V model doesn't have any microarchitectural features you'd need for a real chip - not even pipelining - so it would be very slow.

Still... it is tantalisingly close to a really nice HDL for design purposes. I have considered trying to make a pipelined RISC-V chip in Sail with all the caches, branch predictor etc.

One feature that makes it a little awkward though is that there isn't really anything like a class or a SV module that you can reuse. If you want to have N of anything you pretty much have to copy & paste it N times.

aseipp•5h ago
It says they intend the backend to be used for FEC, so it's probably an untimed model that it outputs. Sail would probably generate bad SystemVerilog anyway even if it was timed/synthesizable because the language doesn't have any concepts to express things like pipelining or the necessary concurrency primitives or properly structured modules for the output netlists.

If you want a high-level RTL with some of the dependent features of Sail, but for hardware that can generate good SystemVerilog, I think Bluespec is probably the best complement.

Cieric•5h ago
I really like the idea of this. I wonder if I can convince my work to use it for our hardware. Are things like SIMD, SIMT, and other weird formats easy to represent in this kind of language? Or should I just assume anything describable in Verilog/HDL can be described in this language.

This also brings up another question if anyone knows. Is there a term for hardware description languages similar to turning complete for programming languages, or is there a different set of common terms?

Niche Creator Monetization

https://tinyidea.net/idea/idea-coj2emzjlp
1•freeourdays•4m ago•1 comments

Monitoring K8s using a combo of daemonset/deployment of OpenTelemetry Collector

https://signoz.io/blog/kubernetes-observability-with-opentelemetry/
1•ankit01-oss•4m ago•0 comments

A Food Reckoning Is Coming

https://www.theatlantic.com/science/archive/2025/06/climate-food-land-problem/683005/
3•littlexsparkee•5m ago•0 comments

Why Cursor is a great company

https://zandrey.com/cursor-is-great/
2•rats•6m ago•0 comments

Cara Membatalkan Pinjaman LazBon LazaDa

1•Lazbon•7m ago•0 comments

CachyOS Kernels Based on Different Schedulers and Performance Improvements

https://github.com/CachyOS/linux-cachyos
2•theycallhermax•7m ago•0 comments

Built an NSFW AI image generator for AI art creators

https://nsfw-image-generator.com/
1•kevinleee•10m ago•1 comments

Personality Dimensions and Temperaments of Engineering Professors and Students

https://arxiv.org/abs/1507.06896
1•fzliu•17m ago•1 comments

Show HN: Launch Hacker News like community on your Domain

1•kocial•18m ago•0 comments

Show HN: Cant, rust nn lib for learning

https://github.com/TuckerBMorgan/can-t
2•TuckerBMorgan•21m ago•0 comments

Neovim plugin to prompt any model from Markdown files

https://github.com/robcmills/prompt.nvim
1•robcmills•22m ago•0 comments

Chemical Process Produces Critical Battery Metals with No Waste

https://spectrum.ieee.org/nmc-battery-aspiring-materials
3•stubish•28m ago•0 comments

Elon Musk opened a diner in Hollywood. What could go wrong?

https://www.theguardian.com/us-news/2025/jul/26/elon-musk-tesla-diner-hollywood
4•rob74•31m ago•1 comments

Doge is suggesting an AI tool that puts half of federal regs on a 'delete list'

https://www.engadget.com/big-tech/doge-is-reportedly-pushing-an-ai-tool-that-would-put-half-of-all-federal-regulations-on-a-delete-list-212053871.html
3•Incipient•33m ago•1 comments

Company developing Paducah laser uranium enrichment hits regulatory milestone

https://www.wkms.org/energy/2025-07-02/company-developing-paducah-laser-uranium-enrichment-facility-hits-key-regulatory-milestone
1•perihelions•34m ago•0 comments

Texas Is Getting Tough on Data Protection

https://www.adexchanger.com/data-privacy-roundup/texas-is-getting-tough-on-data-protection/
1•dotcoma•36m ago•0 comments

ChatGPT Gave Instructions for Murder, Self-Mutilation

https://www.theatlantic.com/technology/archive/2025/07/chatgpt-ai-self-mutilation-satanism/683649/
1•jrflowers•36m ago•0 comments

The future is not self-hosted, but self-sovereign

https://www.robertmao.com/blog/en/the-future-is-not-self-hosted-but-self-sovereign
2•robmao•37m ago•1 comments

Is Australia's bloated property market destroying the middle class?

https://www.theguardian.com/australia-news/2025/jul/13/great-job-good-education-no-home-is-australias-bloated-property-market-destroying-the-middle-class
3•PaulHoule•40m ago•0 comments

Show HN: I built a tool to fight YouTube clickbait with AI summaries

https://www.peekatube.com/en
1•project_stain•42m ago•0 comments

Show HN: Explore GitHub via What Stargazers Also Starred

https://github.com/fengkan/GitHub-Stargazer-Constellation
1•fengkan•48m ago•0 comments

Trump's AI Action Plan is a blueprint for dystopia

https://www.bloodinthemachine.com/p/trumps-ai-action-plan-is-a-blueprint
4•dotcoma•50m ago•0 comments

Are prompts the new unit of work?

https://www.archgw.com/blogs/are-prompts-the-new-unit-of-work
1•honorable_coder•53m ago•1 comments

How to expose Kubernetes OIDC JWKS endpoints

https://gawsoft.com/blog/kubernetes-oidc-expose-without-anonymous/
1•gawsoft•54m ago•1 comments

William Cowper's pet hares [1784]

https://cowperandnewtonmuseum.org.uk/the-history-of-my-three-hares/
3•quuxplusone•56m ago•0 comments

Post to HN

https://blog.cloudflare.com/zero-trust-warp-with-a-masque/
1•sawoo•1h ago•0 comments

$Lei – Aesthetic Computer

https://prompt.ac/$lei
1•justanothersys•1h ago•1 comments

Verify Identities During Self-Service Registration

https://fusionauth.io/blog/identity-verification-before-registration
1•mooreds•1h ago•0 comments

Fast and cheap bulk storage: using LVM to cache HDDs on SSDs

https://quantum5.ca/2025/05/11/fast-cheap-bulk-storage-using-lvm-to-cache-hdds-on-ssds/
19•todsacerdoti•1h ago•1 comments

Measuring Engineering

https://fffej.substack.com/p/measuring-engineering
1•mooreds•1h ago•0 comments