
Ask HN: What's something you'd like that programming languages don't do? - westicecoast32
For example Andrei Alexandrescu likes how much you can do with static if in D however he thinks languages needs to have more powerful reflection.<p>Jon blow wrote his language so he can both modify the AST during compile time and write compile time rules without writing a plugin<p>I&#x27;d like more errors and warnings to be in a language, such as when I modify array [0] and [2] but not element [1] and extra warnings when I do strange things with a bunch of if&#x27;s (hard to explain so I&#x27;ll spare you).<p>What are yours?
======
zzo38computer
I would like setjmp/longjmp with the ability to catch and continue in order to
execute cleanup actions. Most programming languages have one or the other, not
both. But, consider that A calls B and B calls C, which uses longjmp to return
to A, but B has to clean up some resources, it should catch and continue.

Another thing I would like to have is better bitwise manipulation operations.
I find the MOR instruction of MMIX is sometimes useful, and so is the ~
operation of INTERCAL. I also thought of a operator which can be like any one
of the C operators + or | or ^ since it is assumed the result is the same in
all cases (which will be the case if the bitwise AND of the left and right
operands will be zero).

I also agree I want to modify the AST during compile time, using macros.

Many modern programming languages lack a GOTO command, but I think that
imperative programming languages should have a GOTO command.

Something that I might want to have is something like LLVM with macros added,
although LLVM is itself deficient in some ways (e.g. no support for decimal
arithmetic, no support for overlapping data with instructions (e.g.
reading/writing immediate operands of other instructions), some calling
conventions are missing, and you can't make stable undefined values longer
than one bit).

For GPU programming, I think to want something like Checkout.

------
the_hoser
I'd like a compiled language that feed optimization strategy notes to the
editor, so the editor can describe to the programmer what the compiler plans
to do to optimize features of your code.

~~~
westicecoast32
That's a really good idea. That's what I use compiler explorer for but I do it
poorly. CC: llvm

------
yen223
Algebraic effects is very interesting to me.

A try...catch block allows one to define how an exception is handled within a
given block. You can take the same function, and wrap it in a different
try...catch block, and have the exception handled in a different manner.

Algebraic effects would allow one to define how a side effect (e.g. database
queries, logging, etc) is performed within a given block. You can take the
same function, wrap it in a different block, and have its side effects handled
differently. You could have Logging effects write out to stdout in tests, and
write to Splunk in production code, for example.

This would give a nice language-level, type-safe construct for implementing
dependency injection, without the usual kludges of traditional DI frameworks.

------
karmakaze
1\. Delayed function argument expression evaluation. Only evaluate the
argument if the result is consumed.

You can get close using Callable<V>/.call in Java or better with 'lazy' in
Kotlin, but I want it to be default behaviour. Even 'let' in Lisp/Clojure is
sometimes annoying being eagerly evaluated.

2\. 'var' function argument and return types. Basically allow type inference
to work through a call stack.

Basically I want F# features to be in more popular languages.

------
aogl
I wish I could code in Python and compile down to run natively like C, or even
Go. The more I've used the language, the more it just feels natural, but it's
so limited in A.)native compilation and distribution, and
B.)multithreading/processing just sucks so bad.

------
qppo
Tooling in mind, and assume that the language is not the only language in
existence. A large part of my career has been spent writing scripts to duct
tape together tools from different languages or write custom tools to deal
with friction in a development environment.

~~~
westicecoast32
Could you get a little more into this? I never had to do anything like that
since all my workplaces only used 1 language + js

------
glram
I'd like a language that allows me to explicitly annotate my code for
vectorization/SIMD. Too often compilers aren't able to vectorize efficiently
because the heuristics don't detect the opportunity.

~~~
westicecoast32
I had a thought on this but it's alot of work for one person and IDK if anyone
would use my language for that.

I agree tho. I been learning SIMD and the operations it supports are pretty
neat

------
7373737373
(possibly optional) full determinism, serializable threads for mobile agents,
recursive sandboxing for running untrusted code

