Bridging the Gap Between Languages (with Martin Johansen)
Vložit
- čas přidán 16. 07. 2024
- If you ever feel overwhelmed by the number of different programming languages, this week’s episode might just offer you some solace, as we talk about an attempt to reunify many of the most popular languages by focussing on the bread & butter things that every language supports.
I’m joined by Martin Johansen, who’s been working on a new tool called Progsbase. With it, he’s created a spec based on all the things programming languages can agree on, and is building a library that can cross-compile between them. Write a program in Java, and it can be automatically translated to PHP, Python and a great deal more.
But how far can he take that idea? Is there really enough unity between these languages to build something universal? How do you bridge the divide between manual memory management languages like C and garbage-collected ones like Java? And what would it actually feel like to write code this way? Let’s put Martin’s plan under the spotlight and find out…
-
Martin on Twitter: / martinfj
Kris on Twitter: / krisajenkins
Kris on LinkedIn: / krisjenkins
Progsbase homepage: www.progsbase.com/
The Spec: www.progsbase.com/docs/programs/
The Progsbase library repository: repo.progsbase.com/
The Bug Bounty: www.progsbase.com/bug-bounty/
-
0:00 Intro
1:37 Podcast
47:30 Outro
#software #programming #podcast #programminglanguages
Ooh, nice idea of unifying Programming Languages or translating a code into other languages code:
00:00 Programming Languages: similarities and overlap
01:01 An attempt: write in a language and output it to 13 different ones
02:24 On the problem of Software Reusability
03:13 Possible Solution: The Theory and Technology of Progsbase Programming Language
05:17 Progsbase features
07:36 Languages common grounds except Haskell
08:52 Common mechanism failures
10:41 Languages categories: Computational and Infrastructural
11:46 Globals, pure functions
12:13 Memory Management, Java or C++ translations
13:43 Practical Limitations
15:46 Exceptions and error handling
17:15 On idiomatic programming patterns
19:35 Style, rather a language to rule all other languages
21:52 In comparison to Unison
22:20 Source Tree and Differing Versions
23:59 Open Source and Licensing
24:04 Libraries and AST
26:50 Devices and Networks
29:32 Threads and Serialization
30:27 Code Optimization in Progsbase
33:34 Modules for Distributed Systems
34:25 Different Servers with Different Languages
36:35 Project duration, production and stabilization
37:16 The Company, the project and its tasks
41:00 Language targeting in Production
42:34 For you: $100-$200 Bug Bounty challenge
44:38 Getting Started with Progsbase
47:26 Conclusion
47:41 Point for Reflection
minor nitpick about the intro: PHP started as a thin wrapper around C, so it’s very close to it to this day, and got its object model from Java, so it would be fair to say PHP sits in between the other two.
Would love if time stamps/chapters were added to the vids 🙂
I do admire people that have enough passion to run such projects and to be fair, it's very difficult to predict what this idea will evolve in the end.
As for the project itself, I kinda struggle to see some production value in it:
- you can't really use it for converting old code, as it imposes harsh limitations and will require rewriting the original system
- using it for some "shared modules" in the system with multiple languages - maybe... But then those shared modules will be very limited and not utilizing language full potential
So, it's somewhat the opposite of a web assembly, if I understand it correctly... So, maybe if you could take the web assembly module and "decompile" it into a nice readable code in a preferred language - that would be nice.
But then again, it will be hell, as different languages give you different ways of structuring your code and we will probably get back to "we only support this specific structure of the code for this language".
The objective of putting together generalities, seems to impose decisions that aren't meaningful on any other grounds, such as ditching ints and keeping floats. But design principles create their own (at least seemingly) arbitrary needs in many other places. I wonder if that's a bad sign or something unavoidable.
I didn't finish the video yet. Does he really ditch ints and keep floats ? If so I need to take back my comment about already coding in "Progspace" .
I gave up on the video after the "no ints, only floats" and memory management questions.
@@edwardharman1153 I actually write mostly C and JS . And I try to write them simple enough that I can easily transcribe one to the other .
I stay away from bool and just use int .
if( success >= 1 ){ ... }
Is clearer and more specific than :
If( success == true ){ ... }
The fake free() function doesn't seem like that bad of a solution though .
Interesting engineering concept and discussion. The guest is obviously very talented and prolific in his work. Great podcast!
I'm very skeptical that this common subset approach can lead to a language that high-quality composable code can be written in. The fact that you have manual memory management and error handling through return values makes it sound a lot like C, a language which is notoriously difficult to compose safely. However, the idea of making things simpler to make them more maintainable is something I fully support.
Very interesting but when I heard the idea of sharing libraries between languages, I immediately objected that this is the great purpose of WASM! It also relies on shared abstractions but at a lower level, which allows every features of a language to be used. It can mix languages with or without GC, which is not easy using the guest’s approach. Finally, the infrastructure abstraction would be handled by the WebAssembly component model.
I do really appreciate all the effort put into this project but it cannot compete with the big players that support WASM!
The problem isn't that all languages are the same, but that programmers think they can solve the problem they're working on using their one preferred language. Use the languages, multiple when necessary, that are appropriate to each part of the problem, because every problem is really multiple problems. Too many programmers with hammers seeing every problem as a nail.
Unpopular opinion, but generalizing common patterns from several is just creating another, generic programming language. What makes languages special is the uniqueness, like python has libraries from pip, java has JDK API, and it's libraries, PHP has lots more (funky) functions and each have their frameworks.
I think, even though it would be more chaotic, but combining supersets rather than subsets would make a more in-demand and useful programming language.
My exact thoughts!
Though those weren't things I considered unique regarding php, which uses composer instead of pip.
Holy crap ! My C99 and JS have been written in "Progspace" since 2020 .
What an interesting idea. I’d never have considered it!
This will be well off into the future for me but I have a similar goal but the approach will be extremely different.
The reason for this goal is because I have a computer architecture that is literally infinitely parallel.
Is it on GitHub?
For me, programming languages is not just as tools, but also as arts. 😅
Money
java, php, and python.... literally the 3 worst languages I can think of