←back to thread

14 points Hashex129542 | 1 comments | | HN request time: 0.213s | source

I'm developing a programming language, the keywords and features mostly based on Swift 5 but some additional features like,

1. async function will be called from no async function but no async/await keyword. If you want to block main thread then block_main() function will be used. block_main() /* operations */ unblock_main()

2. protocol can inherit another protocol(s) & protocol can confirm a class like swift.

3. no `let`. only `var`. compiler can optimize further.

4. if (a == (10 || 20 || 30) || b == a) && c { }

5. `Asterisk` is replaced to `x` operator for mul operations.

What are the features you found or you need in a programming language?

Show context
GianFabien ◴[] No.42201532[source]
Apparently, x86-64 has:

    981  unique mnemonics
    3684 instruction variants
Since the architecture and instruction set has been evolving for decades, I often wonder whether the compiler is generating code for some lowly common denominator. If a sufficiently smart compiler were to compile code for the developer's most current CPU, the code will need to be recompiled for lesser systems.

ARM architectures are getting instruction set bloat and RISC-V is also tending that way with many variants being produced.

I prefer minimal syntax, e.g. Lisp, Smalltalk, Self. Then let the abstractions be plugged in with appropriate compiler support. I find the idea of blessed built-in types constrain implementation designs due to their prevalence.

replies(1): >>42204814 #
1. t-3 ◴[] No.42204814[source]
If the compiler were fast enough, code could be recompiled for every deployment. With a comprehensive profiling/benchmarking test suite, it could be even more advanced; all features could be used and quirks accounted for, code/data could be optimized for cache size and bus speeds, etc.