logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

A-new-systems-language.md (4724B)


  1. ---
  2. title: We are building a new systems programming language
  3. date: 2021-03-19
  4. formats: [html, gemtext]
  5. ---
  6. It's an open secret: the "secret project" I've been talking about is a new
  7. systems programming language. It's been underway since December '19, and we hope
  8. to release the first version in early 2022. The language is pretty small —
  9. we have a mostly complete specification which clocks in at 60 pages. It has
  10. manual memory management, no runtime, and it uses a superset of the C ABI,
  11. making it easy to link with libraries and C code. It should be suitable almost
  12. anywhere C is useful: compilers, system utilities, operating systems, network
  13. servers and clients, and so on.
  14. <!--
  15. Hello, clever reader :) I was too lazy to make a dedicated build of Hugo with a
  16. fake name for the language. Since you bothered to check, head to
  17. https://harelang.org for the rest of the details. Please keep it to yourself!
  18. -->
  19. ```hare
  20. use io;
  21. export fn main() void = {
  22. const greetings = [
  23. "Hello, world!",
  24. "¡Hola Mundo!",
  25. "Γειά σου Κόσμε!",
  26. "Привет мир!",
  27. "こんにちは世界!",
  28. ];
  29. for (let i = 0z; i < len(greetings); i += 1) {
  30. io::println(greetings[i]);
  31. };
  32. };
  33. ```
  34. We could compare our language to many other languages, but let's start with how
  35. it compares to C:
  36. - More robust error handling via tagged unions
  37. - Improved, Unicode-aware string support
  38. - Memory safe array, slice, and pointer types (and unsafe versions, if needed)
  39. - Direct compatibility with the C ABI for trivial C interop
  40. - A simpler, context-free, expression-oriented syntax
  41. - A standard library free of the constraints of POSIX or the C standard
  42. Our language currently supports Linux on x86_64 or aarch64, and we plan on
  43. expanding this to the BSDs, Haiku, and Plan 9; as well as i686, riscv64 and
  44. riscv32, and ppc64 before the release.
  45. I plan to continue keeping the other details a secret until the release &mdash;
  46. we want the first release to be a complete, stable, production-ready programming
  47. language with all of the trimmings. The first time most people will hear about
  48. this language will also be the first time they can ship working code with it.
  49. However, if you want to get involved sooner, there's a way: we need your help.
  50. So far, we've written most of the spec, the first of two compilers, and about
  51. 15,000 lines of the standard library. The standard library is what needs the
  52. most help, and I'm seeking volunteers to get involved.
  53. The standard library mandate begins with the following:
  54. > The <span style="color: transparent">xxxx</span> standard library shall provide:
  55. >
  56. > 1. Useful features to complement <span style="color: transparent">xxxx</span> language features
  57. > 2. An interface to the host operating system
  58. > 3. Implementations of broadly useful algorithms
  59. > 4. Implementations of broadly useful formats and protocols
  60. > 5. Introspective meta-features for <span style="color: transparent">xxxx</span>-aware programs
  61. >
  62. > Each of these services shall:
  63. >
  64. > 1. Have a concise and straightforward interface
  65. > 2. Correctly and completely implement the useful subset of the required behavior
  66. > 3. Provide complete documentation for each exported symbol
  67. > 4. Be sufficiently tested to provide confidence in the implementation
  68. We have a number of focus areas for standard library development. I expect most
  69. contributors, at least at first, to stick to one or two of these areas. The
  70. focus areas we're looking into now are:
  71. <dl>
  72. <dt>Algorithms</dt>
  73. <dd>Sorting • compression • math • etc</dd>
  74. <dt>Cryptography</dt>
  75. <dd>Hashing • encryption • key derivation • TLS • etc</dd>
  76. <dt>Date & time support</dt>
  77. <dd>Parsing • formatting • arithmetic • timers • etc</dd>
  78. <dt>Debugging tools</dt>
  79. <dd>ELF and DWARF support • vDSO • dynamic loading • etc</dd>
  80. <dt>Formats & encodings</dt>
  81. <dd>JSON • XML • HTML • MIME • RFC 2822 • tar • etc</dd>
  82. <dt><span style="color: transparent">xxxx</span> language support</dt>
  83. <dd>Parsing • type checker • hosted toolchain • etc</dd>
  84. <dt>Networking</dt>
  85. <dd>IP & CIDR handling • sockets • DNS resolver • HTTP • etc</dd>
  86. <dt>Platform support</dt>
  87. <dd>New platforms and architectures • OS-specific features</dd>
  88. <dt>String manipulation</dt>
  89. <dd>Search, replace • Unicode • Regex • etc</dd>
  90. <dt>Unix support</dt>
  91. <dd>chmod • mkfifo • passwd • setuid • TTY management • etc</dd>
  92. </dl>
  93. If any of this sounds up your alley, we'd love your help! Please [write me an
  94. email](mailto:sir@cmpwn.com) describing your interest areas and previous systems
  95. programming experience.
  96. **Update 2021-03-20**: We're targeting the first release in early 2022, not 2021.