CoolProgrammingLanguageIdeas

ThoughtStorms Wiki

Context : ProgrammingLanguages

Some ideas for mixing and merging the good stuff.

Quora Answer : As a software engineer/ programmer if you could take different features from different languages and cook a new programming language - what would the language be like?

Feb 12, 2019

I have a tonne of these. Here are three :

Modern Smalltalk

I'd take Smalltalk, strip out the whole legacy GUI system, Morphic, everything. Get rid of the whole 70s era WIMP environment.

And build a new UI toolkit inspired by Jupyter notebook and wikis. Basically, the UI would consist of a "notebook" metaphor : each "page" of the notebook would be a one dimensional sequence of "cells" or "cards". Each cell could contain some code in Smalltalk, some documentation in Markdown, or a graphical widget to visualize data or interact with the live objects in the system.

The Smalltalk tools like the class browser, would be adapted to fit within this new UI metaphor, to live on specific pages of the notebook. Navigation between pages would be via hyperlinks. There would be no overlapping windows. No pop-up menus. No strange, hard to grok UI conventions that people outside the Smalltalk world don't recognise. Smalltalk notebooks would be rendered "responsively"; and fit as comfortably on phones and tablets as on desktops.

Today, Jupyter is delivering on the promise of a personal researcher's virtual notebook that Smalltalk was always conceived as. Smalltalk would be great for this, if it could just get a UI appropriate to the 21st century.

While I'm at it, I'd add what I call "assemblage programming" to Smalltalk. A syntax for declaring a bunch of classes and their relations with each other, inspired by Haskell's Algebraic Data types. See Phil Jones (He / Him)'s post in Future Programming for more on this.

(SmalltalkNeedsANewUI)

Convenient Prolog

I'm fascinated by Prolog in principle. But still find it hard to get going with it or do useful stuff.

This is not so much about syntax or the ideas. It's that I don't know how to connect the Prolog systems I've seen to the real world.

What I'd like, is to put my computer and its resources under control of a Prolog-like inference engine. Basically I want a hybrid of Prolog and shell-script.

With knowledge of the file system, daemons, installed packages, running processes etc.

I want to be able to write

is_project(DirNode) :- is_dir(DirNode), contains_readme(DirNode), contains_git(DirNode).
contains_readme(DirNode) :- match("README", ls(DirNode)).
contains_git(DirNode) :- match("\\.git", ls(DirNode)).
is_project(X).

In my terminal shell to list all directories on my computer containing both a Readme file and a .git subdir (from which I infer they are my projects)

Actually I don't just want the low level operating system features visible. I want entire build / automated testing / continuous integration pipelines under logic programming control too. I want to write git-hooks, web-servers, and other event handling daemons using logic clauses. I want Prolog in the package that PHP currently comes in : built into a web-server, embedded in html templating.

Native Clojure

I love ClojureLanguage. It's undoubtedly my favourite practical language of the moment. But in the last month or two I've been writing more C++ than anything else. I still need to work at a low level.

FerretLanguage is a Clojure-like that compiles to native. But I'd like to see a more full featured Clojure-like Lisp that compiles to native code, and has good control of memory. For example, to bring in ideas from Rust into a library of low-level but secure memory management, accessible from a Clojure-like that is otherwise based on immutable data-structures. (See CarpLanguage)

Plus Ferret really needs a version of core.async.

Quora Answer : What is the most interesting combination of programming language types (e.g. dynamic, static, weak, strong, functional, procedural, etc)?

Apr 15, 2019

For me ... I think there's a whole fascinating world to be discovered if we go back and look at declarative logic / relational programming.

PrologLanguage is still basically the last language of that paradigm that had much impact on most people's consciousness.

But just as functional programming is finally getting some traction and people are increasingly using languages from the Lisp and ML families, I think in the next 10 years we'll see a rediscovery of the declarative logic / relational paradigm. And just as Clojure (I believe) was a clever, tasteful and useful improvement / modernization of Lisp. So I think we'll see some equivalent clever, tasteful and useful modernizations of Prolog.

I'm not a huge fan of static types. But it would be interesting to see what a Prolog + decent type system (Hindley-Milner etc.) looked and felt like.

I'm quite interested to see what a Prolog in a "Smalltalk-like dynamic and live environment" looked like. Eve was moving in that direction. Maybe Dynamicland hints at fascinating "event-driven language in the physical world" too.

In fact, the secret, I believe of bringing Prolog into the modern world is to solve the problem of connecting it to real stuff. Real data. A real operating system. Etc.

Perhaps give it a bit of syntax to explicitly represent talking about / interacting with the world outside itself. I'd like to see something like "templates" as a first-class citizen of a Prolog-like language.

Eg. "unification" of a template data-type with slots it contains would fill the template. Which is then just declared to map on to something in the environment : whether that's a file, or the motors controlling a robot, or build-pipeline etc.

I'd love to see a Prolog-like with internal facts automatically mapped to things outside itself.