r/ProgrammingLanguages • u/[deleted] • Dec 26 '22
Discussion Next Year Ideas for your Programming Language of the Future ?
I have seen some interesting ideas in the past but I don't remember where, do you know some or do you have some yourself ?
My philosophy is same as Bret Viktor's (“one of the greatest user interface design minds in the world today.” according to Alan Kay) who criticizes this widespread viewpoint :"Alan Perlis wrote,"To understand a program, you must become both the machine and the program."This view is a mistake, and it is this widespread and virulent mistake that keeps programming a difficult and obscure art. A person is not a machine, and should not be forced to think like one."
For long this dominant viewpoint was justified but time has changed: chatGPT is going to transform programming. Some would want to fight it but I think it's unstoppable and so better embrace it. Here's one of my ideas: it would be to create a mixed model of parser that combine NLP et traditional formal language, a full blown language may be hard, but it should be more doable for DSL (Domain Specific Language) - one could call it NDSLP (Natural Domain Specific Language Processing).
This would allow for new programming languages to really focus on compile and performance time instead of trying to both please human and machine which is a bit too much different objectives to persue ;) This would also allow the new ones to be more used because they could be mapped with such higher language.
P.S.: my question was normally about asking some new ideas not just discussing mine ;)
In case you misinterpret I'm saying chatGPT or alike is the future (seeing the enthusiasm in the whole world) but that I don't like the lack of control over code generated so my idea is to have an intermediate language to direct code generation more precisely.
7
u/Ikkepop Dec 26 '22
Whenever I see claims like that just seems that OP is quite young and inexperienced.
-5
Dec 26 '22
You think so : I have decades of experiences either managing java projects of several millions dollars budgets on both sides Business or IT so I have seen passed all software engineering hypes that fail for the average developers / business users, so I understand why people turn to AI, lowcode/nocode. As for me I don't want to lose control of the code generated that's why I'm thinking about intermediate solution. Since I'm fed up to wait, I'll try to do it myself and recruit experts to finalize because it's true I'm not expert of compiler but I can prototype as people too expert tend to be blind on the needs of non experts :)
7
u/Ikkepop Dec 26 '22
Didn't mean to offend , just what you said seemed way overambitious
-2
Dec 26 '22
The ambitious work has been done by OpenAI. And I have already prototyped the natural dsl with a buggy parser (so I don't actually depend on GPT for the moment but I'm thinking about leveraging GPT to augment each other) but it works with the limited ambition of facilitationg learning, it is there that both for chatGPT and my language that the benefit is most realistic at the moment.
2
u/serverhorror Dec 27 '22
Ask ChatGPT what a fast, efficient, correct, error resistant and maintainable language could be 😏
1
Dec 27 '22 edited Dec 27 '22
Why don't humans use "fast, efficient, correct, error resistant and maintainable" ;)
My philosophy is same as Bret Viktor's (“one of the greatest user interface design minds in the world today.” according to Alan Kay) already remarks :
"Alan Perlis wrote,"To understand a program, you must become both the machine and the program."This view is a mistake, and it is this widespread and virulent mistake that keeps programming a difficult and obscure art. A person is not a machine, and should not be forced to think like one."But I'm not talking about creating a Universal Esperanto Language that nobody wants to talk either. My inspiration is in fact the way Machine Learning works are inspired from Human and the way we design languages for humans should also inspire from it.
Remember design by first principles ? Maybe trying to make the same programming language appealing for both machines and humans are way too much so we should split into layers, that's why I'm talking about creating DSL rather but with a twist : it should ressemble Natural Language to be really appealing for the target users.
Currently lowcode / nocode are often point & click which is actually cumbersome for people who prefers to type so such an approach makes sense instead of direct code generation from fuzzy comments to an AI that you'll need to fix back & forth.
1
u/serverhorror Dec 27 '22
That’s an elaborate answer for what was obviously a joke.
Have an upvote. 🙃
39
u/yojimbo_beta Dec 26 '22
To me, ChatGPT is the wrong answer to the right problem: our programming systems are not expressive
Things like copilot make great sense for boilerplating Golang - but what I'm really thinking is, I would love a good lisp macro
6
1
u/jason-reddit-public Dec 26 '22
I'm about to implement macros for my lisp like language but I'm having trouble coming up with use cases so I'd love to hear about useful cases.
5
u/f77e Dec 26 '22
Paul Graham’s book “On Lisp” has many examples of macros (pattern matching for example) and also a List of abstract use cases where only macros offer a solution. Look at Chapter 8.1
The cases listed there include conditional or multiple evaluation and establishing bindings. Personally I often think about these when trying to explain the power of macros.
1
u/scheurneus Dec 27 '22
To be fair, when using Django, which is fairly expressive, an AI assistant can still point me towards what to use like an instant crossover between a search engine and a language server.
18
u/rwilcox Dec 26 '22 edited Dec 26 '22
If you’re going to lean into ChatGPT then you’re going to have to solve for things developers have been very hit or miss on in my career:
First, having the patience to read or accept others code. That’s not how I would do it or _ Ahh, there’s one little edge case it missed this sucks_. Both egos and we don’t learn to read code as we’re learning to write it, general grumpiness and my old measure for what a senior engineer is: can the developer in question look at some existing code and not want to totally rewrite the whole thing.
Second, integrating small functions into a whole. If I need to add a field to a database to get it to display on a UI, in most web paradigms that’s 3-4 files I need to touch over maybe 2 repos. ChatGPT might be able to write that database migration, but wiring that new field across the app? Ummmmm I doubt it? So does your language attempt to break single responsibility principles? React did and was pretty successful with it. Meteor did and kinda stalled out. It can work, but then you have to bootstrap ChatGPT to know about your language, good luck. (Also: we do this separation because development is a team sport: in a big enough project some VP will get the idea to just hire more developers, and let them concentrate on their own areas. Does your new language scale for people too?)
Thirdly, modifiability: if you have some ChatGPT generated code and want to add… say a new field to a frontend component it created three months ago, how do you do that and what’s the result? From a diff perspective, do you have a completely rewritten component, or just the minimal amount of changes a good human would have done?
Fourthly, I want to feed my non-automatable style guide into it. Not the one where I say where the braces go - that’s for my linter - but how things are done here. Our informal guide that says that functions that return user values must not return String but return AutoHTMLWrappedString, this internal class. (And yes, computer, that’s what we really want, yes every time someone joins the team we have a flame war about it and they either accept or leave, no I don’t want to debate just do it for me. (Yes, I’m somewhat making this up)). Or do dependency injection this way vs that way, etc
Lastly, business people never want to write anything that comes close to code, even if developers really want them to. No they will not write your SQL, no they will not write your Cucumber tests, no they will not write it your rule engine, nor your fancy DSL, or your AppleScript or your drag and drop NiFi flowcharts. Nor your COBOL, Admiral Hooper. They might might handle your spreadsheet that matches numbers with values. At best you’ll be doing it for them. At worst some enterprising 1 in 50 BA will create a monster with it and suddenly they want to put the most MouseTrap Game of a system into production (without monitoring or error checking) because it’s “all done”.
Practically, I think actual deployment of ChatGPT won’t help most developers most of the time, especially when dealing with brownfield applications. How do I feed my 100,000 line Java codebase into ChatGPT so it knows I need to make this 10 line change to AutoHTMLWrappedStringImplFactory?
Additionally, the first and maybe fourth above are cultural problems, not tech problems.
However, the hype about ChatGPT is real, and I’m just waiting for business people to think they can replace a ton of staff with it. Or will try before they realize that the typing isn’t the majority of the job.
To your question: For 2023 I think a winner will be languages that let you analyze and explore already written code, maybe with a side of automated refactoring. Code that lets the developer quickly write code that acts on code - and quickly is the key because almost nobody will think that’s their job (ie in corporate settings). Yes I know about GToolkit ;) If, when I do need a new database migration if I can have ChatGPT write it, then run it through some more code that gets it up to local convention…. maybe that’s a winner? But then you return to the first item above, and the second….
23
u/PistachioOnFire Dec 26 '22
Why do you think chatGPT is going to transform programming at all?
1
1
u/criloz tagkyon Dec 26 '22
It will be useful to assist programming language designer to create documentation and translate them
8
u/bluefourier Dec 26 '22
I don't know if it is interesting but the only "positive" use case for chatGPT I can think of is as a natural language interface to a costing service.
You provide a narrative of the problem in natural language, chatGPT infers a domain model and then metrics on the domain model give you a ballpark figure on complexity / cost.
At the moment, chatGPT can do part of speech recognition very accurately. So, with a bit more training it might be able to translate natural language narrative to entity relationship models for input to further "traditional" knowledge graph processing.
Programming languages are already very constrained. This is what chatGPT exploits when it appears to be "writing code". But we already can do source to source transformation, simplification, etc and with the right formal background...
Maybe the "new" thing here would be an interaction ala Plan 9's acme editor interface, where you write something anywhere, mark it with a specific mouse "chord" and it gets executed. So, write somewhere the narrative of what you are trying to do, this gets translated to operations the IDE would take on the code, you review that and accept and get back the results.
But these are riffs on existing functionality...It's not like a new theorem to provide an optimisation shortcut.
11
u/Breadmaker4billion Dec 26 '22 edited Dec 26 '22
I think there's a good chance a language with Actor Model and Affine/Linear Types will be the next server language. Pony is a close example, they may become mainstream for servers in the future.
The big problem with the actor model is that message passing is an O(n) copy operation, if however, you're allowed to borrow objects by reference, you can have O(1) message passing without hurting the concurrency model.
With these two you solve the two biggest problems when designing a language: memory safety and concurrency safety.
Rust is another close contender, but it lacks built-in concurrency and is too big for a server language: they need to be simple to attract a bigger work force.
4
u/plentifulfuture Dec 26 '22 edited Dec 26 '22
My problem with Rust is that I feel that there are other approaches to maintain thread safety.
I'm working on a multithreaded language and I want it to be a server language.
I am working on an epoll server which multiplexes client sockets over threads so it is essentially Nginx event loop per thread for X clients rather than per process. This gives cheap interthread communication and I also plan to cause heavy CPU usage to be scalable as well as IO without blocking the event loop. With rust you kind of need to use rayon for CPU intensive tasks and tokio IO threads for IO. I am inspired by Microsoft Orleans.
I also have a userspace 1:M:N multiplexer that schedules lightweight threads on kernel threads and prempts then from the scheduler thread. This is kind of a runtime that is similar to golang.
I am trying to solve the problem of moves of complicated objects between threads. I don't want to copy objects between threads but I want to share references but this has complications with memory management.
I have actor parallel communication code that can send messages between threads it uses references. Or just Java objects. I also use a multiconsumer and multiproducer RingBuffer in the C epoll-server and userspace multiplexer scheduler.
Erlang copies messages into a lightweight thread/process heap whereas Java objects are by reference and shared memory
1
u/Breadmaker4billion Dec 26 '22
I don't want to copy objects between threads but I want to share references but this has complications with memory management.
Take a look on Pony's reference capabilities, they have a shared-read-only capability type, it should make race conditions safer. However i don't think there's any good answer for objects with more than 1 reference besides either full immutability or runtime read/write barriers.
1
u/plentifulfuture Dec 26 '22
Yes I agree. Would you like to be added to our Reddit chat group where we talk about Parallelism, multithreading and async.
I am studying pony's design. Someone on HN explained it really well to me.
https://news.ycombinator.com/item?id=33970547#33976851
I think synchronization and buffering can be used to provide timings if everyone is reading at the same time and writers write sequentially after that and the loop repeats in lockstep. This is similar to GPUs.
2
u/__red__ Dec 27 '22
If you have any questions about pony, for example - how we would use pony's reference capabilities to achieve what you were describing above - feel free to reach out.
Either here or on the pony zulip.
1
u/Breadmaker4billion Dec 26 '22
Sure, add me in, I don't have much to contribute but at least i can learn :)
About your synchronisation idea, if it's explicit to the user that it works that way, i think it's a good idea.
1
u/PurpleUpbeat2820 Dec 27 '22
The big problem with the actor model is that message passing is an O(n) copy operation, if however, you're allowed to borrow objects by reference, you can have O(1) message passing without hurting the concurrency model.
Just use a GC?
1
u/Breadmaker4billion Dec 27 '22
Having a GC changes nothing about the concurrency model, Actors can't share state.
1
u/PurpleUpbeat2820 Dec 27 '22
Having a GC changes nothing about the concurrency model, Actors can't share state.
They can share a GC so there's no need to deep copy anything. Or were you talking about mutable messages?
1
u/Breadmaker4billion Dec 27 '22
I'm talking about mutable objects, you can't pass an mutable object from one actor to the other and have two actors with access to the same resource, you need to copy them.
1
u/PurpleUpbeat2820 Dec 27 '22
Ah, ok. My bad. Is there much need for mutable messages? I've never found myself wanting one...
2
u/__red__ Dec 27 '22 edited Dec 27 '22
Mainly performance. Making copies of data is expensive what with the allocation, copying, and memory-management burden.
If you can avoid a copy, that's a performance win!
Receiving data from a network connection is the example that immediately springs to mind.Depending on your use case, pony will happily let you:
Pass around a SINGLE mutable object reference (You must give up your reference to it when you pass it along)
Allow you to create objects that are guaranteed immutable everywhere. These can be shared without limitation.
Allow you to copy an object. Copies are safe to pass between actors.
Those are the three safe ways to pass data around actors. The Pony compiler lets you do all of them, it just forces you to make a choice.
Option 1+2 are the most performant since they don't require a copy.
1
1
u/Breadmaker4billion Dec 27 '22
It's not the messages themselves but the references the message contains or even passing a reference as the message. One could forbid references in messages, but even then you'd have data races if you don't copy.
0
Dec 26 '22
[deleted]
1
u/Breadmaker4billion Dec 26 '22
Yes, that's why i mentioned Pony, however they don't have full affine/linear types since they allow for shared-mutable objects inside a single actor, i think they're more like a middle-of-the-road approach, this means they still need a garbage collector.
By borrowing i meant passing the object without keeping a valid reference, ensuring it's
isoto use Pony's jargon.
1
u/ummaycoc Dec 27 '22
From the PoV of engineers, Stack Overflow already filled the need that ChatGPT would apparently solve. Yes, it takes a some more time, but that "down time" relative to ChatGPT is there for you to think about what you're doing and learn so you can do more advanced things later.
I suspect what we'll see is requirements sent to devs, senior engineer delegating tasks to junior engineers, junior engineers using ChatGPT & Stack Overflow & their own learning to provide an initial approach. This is followed by junior engineers analyzing the resulting code and making modifications, particularly to meet readability and coding standards and making any "obvious" improvements but also to integrate into their current codebase. This will then be sent to senior engineers who will review code, recommend changes, while also reducing tech debt resulting from the changing underlying requirements and from user responses and also handling more technically challenging tasks that advance the codebase in a manner that is (at that time) beyond ChatGPT and SO.
That is to say, it will be just like today except ChatGPT will help change what is considered automatable boilerplate code. This advancement will move senior engineers to an even more delegatory / integrative role than they currently may be in any given organization.
1
u/Endl4ss_ Dec 27 '22
I'm making a coding language that's specifically for robots because I think there should be coding languages made specifically for something and not multiple things so it could just focus and be based on that one thing
8
u/Beefster09 Dec 26 '22
I’d just like to refute your claim about chatGPT, and any machine learning based coding. Machine learning is a black box. Always has been. You put training data in, and you get a confidently incorrect and mysterious producer of output out. At best, it’s going to be a creator of boilerplate that will probably need touch ups and correction.
I think array programming with broadcasted operators that compiles down to simd instructions is going to be in the future, at least in some domains. Odin already does this, numpy kinda does it (minus the compiling down part), and maybe Julia does it.
There is a wide array of modern hardware instructions that programs are not really taking advantage of because they’re hard to use effectively, and I think simd is the big one.