Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

D and Nim both offer that. D has a tool, rdmd, that compiles (with caching) and runs a script written in D, so you write

#!/usr/bin/env rdmd D code ...

and run it as if it were an executable.





If you want to write a code example on HN you can just indent it by 2 spaces and it'll work like you'd expect. For example:

  #!/usr/bin/env rdmd
  D code...

Thanks. I didn't catch that it didn't display correctly until it was too late to edit it.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: