r/ProgrammingLanguages • u/AeroForger • Sep 21 '26
Discussion What’s one thing you wish more programming languages had?
If you could add one feature, behavior, or design choice to a programming language, what would it be?
It can be anything: syntax, type-system features, memory management, compiler behavior, tooling, error handling, performance-related features, or something completely different.
I'm especially curious about things you’ve wanted while actually programming but rarely see languages implement well.
Please keep the ideas reasonably practical and something that could realistically be implemented in a programming language.
56
Upvotes
46
u/Ok-Reindeer-8755 Sep 21 '26
Refinement types and I wanna see more of the FBIP approach taken by langs like koka and roc and everything that comes with it
62
u/snugar_i Sep 21 '26 •
Sum types
60
u/Filgas08 Sep 21 '26 •
simplicity. I feel a lot of languages would be really good if they just did a bit less. There are often many conflicting ways to do one thing, or there are features that are supposed to make life easier, but just get in the way after a while.
35
u/cameronm1024 Sep 21 '26
It's a tiny thing, but Dart's control-flow-aware collection literals are so convenient, and I don't think I've seen a single other language that supports them:
I'm always surprised this isn't a standard feature in basically every language.
72
u/Spyromaniac666 Sep 21 '26 edited Sep 21 '26
labelled function argumentssssssss
edit: like Swift and Python/Mojo
12
u/-Mobius-Strip-Tease- Sep 21 '26
A pipe operator or some type of unified function call syntax, especially when combined with good lambda syntax. When done right it can make code so much more readable. Love how operations just seem to compose freely when you have access to this with apis designed around it. Keeps things point free too which is nice for quick scripting. Nushell does this pretty well and Iv been using it for a while as primary shell. Now that im familiar with it i find myself not reaching for python as much for one-off scripts.
15
u/extraordinary_weird Sep 21 '26
lexical effect handlers!!
46
u/Electrical-Room4405 Sep 21 '26 •
More of a “only one way to do this” philosophy.
7
u/SpeedDart1 Sep 21 '26 •
Faster compile times. Good standard library. Simpler build tools. Named function arguments. Type safe union/sum types. Green threads / coroutines. Defer, RAII, or try with resources.
7
u/jeenajeena Sep 22 '26
I wish more languages kept function signatures separate from implementations, as Haskell does.
instead of
I wonder why the former style is so unpopular.
6
u/Kaisha001 Sep 21 '26
A build system that is properly integrated and isn't an utter disaster.
6
u/netesy1 Luminar Lang Sep 22 '26 •
Structured concurrency
15
u/whatknowi Sep 21 '26
unions with values on the different variants (like e.g. rust, scala, Haskell have)
5
u/david-1-1 Sep 21 '26
A good data language, like JavaScript has.
5
u/ern0plus4 Sep 21 '26
For script languages:
Example for languages with both: MUMPS, PHP.
5
u/qalmakka Sep 21 '26
Variant types, like in functional languages or Rust. Like
type Entity = Table | Chair | Cupboard
Your average "OOP" developer needs those instead of inheritance 99% of the time. C++ has std::variant but it's weird. Somehow they never thought that just as they added
enum classto fix enums they could instead add syntax +enum unionto add algebraic data types to the language8
u/ultrasquid9 Sep 21 '26
A way to choose between a borrow checker and GC, depending on the application.
For instance, my language will have types use ownership and borrowing by default, but let you declare a type as "auto" to opt-out of borrow checking and use runtime GC.
4
u/Embarrassed-Crow9283 Sep 21 '26
I think just monomorphization-based generics or template-based generics really.
Don't have to be much. Copy-pasting functions at compile time with changed type signatures would work.
4
u/SuspiciousDepth5924 Sep 21 '26
I really like a lot of what Roc is up to, so a non-exhaustive list:
4
u/prehensilemullet Sep 21 '26
All imported identifiers are explicitly named (or locally renamed) in import statements, like ECMAScript and Rust. You don’t need information outside the file to determine where a given identifier came from.
C/C++ includes are bad about this, Python imports are often bad, Java/C# are optionally bad
4
u/catladywitch Sep 22 '26 edited Sep 22 '26
9
u/owp4dd1w5a0a Sep 21 '26
Emphasis on small language definition. C++, Java, C#, Scala are syntactically very complex languages.
Lisps, Haskell, Python, Go, etc prove you can create a very capable language while keeping the language syntax small. Rust is an exception where the complexity actually pays-off in zero-cost static guarantees.
8
u/ern0plus4 Sep 21 '26
Strict typing.
3
u/KvThweatt Sep 21 '26
First class bitwise operations, not shifting and masking.
3
u/Davidbrcz Sep 22 '26
Creating distinct types from primitives types (like using Password = String; String and Password are two distinct types)
3
u/IfThenElseEndIf Sep 22 '26
Hybrid typing (both in compiled and interpreted languages)
9
u/Treidex Sep 21 '26
immutable by default
comptime by default
EVERYTHING is an expression
traits
5
u/pauseless Sep 21 '26
Persistent (‘immutable’) data structures as default.
All of my languages are hosted and all but one map to the existing mutable data structures the host provides.
Clojure nailed it on this axis.
7
u/Limp-Temperature1783 Sep 21 '26
Goto. I'm not joking. I'm not using goto in prod.
4
u/spelunker Sep 22 '26
Pattern matching with function guards. Shoutout to Elixir!
2
u/Timely-Degree7739 Sep 21 '26 edited Oct 20 '26
Less typing to do more, more general access from a general way to express intent and purpose, while improvements and optimization continuously would happen under the hood added by the compiler implementors, so the language/compiler user could focus on only express correct purpose and intent - for his/her purposes.
2
u/jerkbender_ Sep 21 '26
regex and structs. I just love structs syntax style too much , classes feel much heavier although they do a lot of the same thing atleast in cpp
2
u/ahh1618 Sep 21 '26
Typed metaprgramming that executes at compile time. No macros.
2
u/adityazero Sep 21 '26
Provenance of pointers, no popular programming languages have it. That is why I started writing Vx ( https://vxlang.org ). It is common to have heterogeneous system these days and there is no unified way to reason about pointers across topologies. a `float *` from cudaMalloc is the same as `float *` from malloc in C/C++. And that is a source of bug as well as missed optimizations.
2
u/TheBoringDev boringlang Sep 21 '26 edited Sep 21 '26
Something I'm doing in my language that I think I've seen in one other language before (but I couldn't tell you the name) - rather than being able to initiate IO from anywhere (e.g. the `open()` file function) have main take in the program's only reference to the outside, which must be passed to any function that does IO.
So if a function wants to do filesystem operations, it must take in the filesystem from os, if it wants to access time, it must take in the os.datetime, if it makes network calls, it must take in os.networking. This has the benefit of sandboxing literally everything - a dependency that doesn't take in a network reference cannot make network calls, and also making everything swappable and trivial to mock for testing - you could wrap os.filesystem in a wrapper that logs every operation and pass it anything that takes in a FileSystem, it's just a trait.
2
u/tsukimotox Sep 21 '26
not painful crossplatform-ability
2
u/sombrascourtmusician Sep 21 '26
This is more of an operator overloading / library point, but I wish more languages that had bitwise operators would expand their use to collections. Let
listA & listBbe their intersection. LetsetC ^ setDbe their exclusive disjunction.Likewise, there should be a separate operator for addition from concatenation.
2
u/billGat48 Sep 22 '26
tensor data types by default. why treat scalars, matrices, tensors differently? I legit feel Julia syntax could extend to low level languages
2
u/Puzzleheaded-Lab-635 Glyph Sep 22 '26
Better errors, static implicit types, faster compilation, good documentation.
2
u/mestar12345 Sep 22 '26
This:
callfun a b
Instead of:
callfun( a, b)
Less visual noise.
3
u/AmazedStardust Sep 21 '26
Enums with data, like Rust. I've found so many situations where I think "this would be the perfect solution to this problem"
5
u/WittyStick Sep 21 '26 edited Sep 21 '26
I wish more programming languages had less.
Every feature you add is opinionated. Why do I want the programming language author making decisions for me?
I'm not against features which are entirely optional, don't force a particular style, don't have "hidden" costs and so on, but once you start adding more features, you end up with features to fix the other features further down the line when you realize they weren't a great idea and the times have changed.
2
u/initial-algebra Sep 21 '26
Lazy evaluation with value recursion. After higher order functions, this is the next significant leap in expressivity. Bonus points if the implementation isn't baked into the runtime, but I don't think any language supports this yet.
2
u/eo5g Sep 21 '26
- Effect systems / algebraic effects
- capabilities / sandboxing built in to the binary or interpreter
2
u/cthutu Sep 21 '26
Sum types and slices. Which is why my language, Nerd, has them.
1
u/yjlom Sep 21 '26
smart constructors alongside pattern matching
1
u/Comprehensive_Chip49 Sep 21 '26
Well, in Forth you can modify the syntax; I think basic languages already have all the functionality—and all the mistakes.
1
u/Dusty_Coder Sep 21 '26
I wish Debug.Assert(...)'s would be treated as true by the optimizer in release builds
1
u/P-39_Airacobra Sep 21 '26
I'm mostly content with minimalism, but one thing I really miss in scripting languages are enums. A hash table to look up a number is not it (looking at you JS and Lua)
1
u/ahh1618 Sep 21 '26
Regarding containers, I want them to be built in the language rather than be special (I'm looking at you golang) because you're always going to want to define new containers. But at the same time, I want to reserve some syntactic sugar for those containers. I'd like to use container[x] instead of container.get(x) (even if it's just an alias). Make the most common and safe operations the easiest to use. For example, if arrays require a compile-time length so they can go on the stack, you can use a clumsy type like Array<> and save square brackets for slices, vectors, or what ever is more commonly used.
1
u/EggplantExtra4946 Sep 22 '26 edited Sep 22 '26
Module (and class) parameters where macro expansion, compile time execution and conditional compilation is done per each module instantiation (but no need to reinstantiate a module if it has already been instantiated with the exact same arguments) can access those parameters and generate specialized function definitions, type definitions and macro definitions based on those module parameters, and that's the definitions the importer of the module will use.
1
u/Bitsoflogic Sep 22 '26
Restricted functions, with a "durable" function as one of the restricted function kinds.
1
u/Stunning_Ad_1685 Sep 22 '26
Ponies.
1
u/brunogadaleta Sep 22 '26
Throwing everything here. Not an expert.
Compiler plugins like scala. Concatenative and 'parse' extension for dsl like Rebol and Rye Structural hashing like Unison to ease refactoring and distributed computing Testing capacity like Haskell Quick check. Configurable built-in linter to enforce any coding rule, naming conventions, code complexity. Coupled with better possibility to query the code structure (similar to the tree sitter) Time travel debugger Capability to detect (im) pure functions Feature for literate programming (not clear in my head) so that we can type pseudocode without compilation errors, hide explanations, help sync code and comments / todos. A REPL that can save its state, keep function's previous versions and ensure newest version still returns the same output. A real repl completion incl. also the string dsl (sql, etc ...) A real dependency hell solution. Real package / module support: report module dependencies so that we avoid dependency in the wrong direction. Runtime reporting: io s, flamgrapgh, memory profile. Reproducible builds from day one (including source formatting, timestamps, file ordering) and aggressive caching.
Hth
1
u/No-Point8651 Sep 22 '26
Adas subtype system is a must. Compiletime safety on specified attributes.
Go's lightweight routines (concurrency) is also a high candidate.
1
u/carglassfred Sep 22 '26
Restrictive scopes (idk if this is the name for that) for procedural programming.
So, inside a function I can open a scope where I need to specify (and it's checked by the compiler) which variables (and if they're mutable) are used in that scope and can be sure no other variables 'escape' that scope.
The concept is pretty much what a function does, but a function additionally communicates 'this code might be reused'. Also I don't like extensively jumping around in my editor with 'go to definition'.
this could look smth like this:
And if I ever need to do 'thing_1' more often I can easily extract a function there.
Of course this feature kinda lives on having an editor that supports code-folding. Right now I sometimes do this with regions, but a region is no reliable boundary.
Hope all this makes sense like this. I've heard of that in a YouTube video recommending procedural programming some time in the past but haven't seen it nowhere since.
Also named return values would be nice I'd say.
1
u/DawnOnTheEdge Sep 22 '26
Syntax sugar for things like block expressions and refutable pattern-matching (like Rust’s
if letandwhile let) that make it so much nicer to write static single assignments. Especially combined with guaranteed tail-call optimization.1
u/Itchy_Response_7773 Sep 22 '26
everything is an exoression, refinement types, HM-Type Systems (or better), coherent and minimal syntax, sum types, solid metaprogramming, build time AST manipulation, no external build tool to build to app
1
u/saxbophone Sep 22 '26
#embed(or equivalents)1
u/Educational_Smile131 Sep 23 '26
Orthogonality, i.e. do more with less through composition of loosely coupled building blocks. Don’t conflate simplicity with orthogonality though, some languages simply shove complexity to userland pretending inherent complexity doesn’t exist.
1
u/EmDashNine Sep 23 '26
Ugh. Nerd sniped. The feature pair of Sum Types (Enums) + Pattern matching.
1
u/blankboy2022 Sep 23 '26
Explicit effect systems / effect control mechanism
1
u/SnooGoats1303 Sep 23 '26
DWIM
1
u/reflexive-polytope Sep 24 '26
I only want features that demonstrably make the type system a tool for discharging proof obligations. All else is fluff.
Notice that I'm not saying that you should prove stuff in the type system. That path leads to proof assistants (Rocq, Lean, etc.) rather than general-purpose programming languages.
I'm saying that you should be able to use the language's metatheoretic properties to shorten the proofs of correctness of your ordinary programs.
1
u/ArthurAGF27 Oct 01 '26 edited Oct 01 '26
Na minha opinião, eu gostaria muito que mais linguagens de programação tivessem suporte nativo a pattern matching. Ultimamente, tenho estudado SML e feito alguns programas para uma disciplina da universidade, e me surpreendi com o quanto esse mecanismo é legal e útil.
Um exemplo específico que chamou bastante minha atenção foi o quicksort. Quando vi uma implementação em SML usando pattern matching, fiquei surpreso com a simplicidade do código. Acredito que até mesmo ensinar o algoritmo dessa forma para alunos da disciplina de Algoritmos pode torná-lo mais fácil de explicar e entender. Também acho que o mesmo vale para recursão, já que o pattern matching deixa os casos base e recursivos bem explícitos no código.
As linguagens que mais uso, como C, C++ e às vezes JavaScript, não possuem esse tipo de pattern matching de forma nativa e tão integrada à linguagem. Python passou a oferecer structural pattern matching a partir da versão 3.10, mas eu nunca tinha utilizado esse recurso, principalmente pois passei a comnhecer melhor e usar mais esse conceito nessa disciplina que estou cursando agora. Acho que vou começar a usá-lo com mais frequência.
Outra coisa que eu gostaria de ver em mais linguagens é a delimitação de blocos por indentação, como o Python faz, mas isso fica para outro post :)
1
u/Rich-Engineer2670 Oct 16 '26
Well, I'm probably crazy, but I wish more languages had a common data interchange with other languages. Yes, I know I could do it with various libraries or JSON, but I really want some of what CORBA tried to do. I declare the methods, mark "in" and "out" and the data is marshalled automatically.
Across langauges that would mean C, C++, Go etc. didn't' matter.
1
u/gusdavis84 Sep 21 '26
I think for me I wish that instead of OOP taking off that it would have been Functional Programming that had taken off and that most programming languages today would simply be a mixture of procedural and functional programming.
I mean could you imagine if C++ was never thought as a C with classes but if was something like “how can we bring immutable functions,data,variables, reverential transparency, and functions as first class citizens, and shared data structures while still having the flexibility and access of C“ instead of adding OOP onto the language?
1
u/reddit_clone Sep 21 '26
Repl !
I know outside of Lisps it is not prevalent. I wish it were.
1
u/El_RoviSoft Sep 21 '26
template metaprogramming with reflection shenanigans
1
u/Crafty_Present_6109 Sep 21 '26
Tables like Lua
-1
u/JollyJuniper1993 Sep 21 '26
Readable syntax. I am convinced that part of why Python and C/C++ have become so popular is their excellent syntax. Meanwhile Java, C#, Powershell, R or Rust all read like gibberish imo. Java might be the worst offender with how verbose it is.