
Languages I want to write - zdw
https://blog.wesleyac.com/posts/language-todos
======
bjz_
> A language with dependent types and borrow checking

I'm definitely interested in this! There are significant challenges here
though, particularly with respect to combining dependent types with effects
and coeffects! This is open research, but significant progress is being made,
and I'm hopeful. I'm currently keeping an eye on [https://github.com/granule-
project/granule](https://github.com/granule-project/granule), which seems like
it might have some interesting things to say about this.

Currently I'm trying to learn how to implement dependent types in my
programming language, Pikelet: [https://github.com/pikelet-
lang/pikelet](https://github.com/pikelet-lang/pikelet) (currently doing a
rebuild of the front-end in [https://github.com/brendanzab/rust-nbe-for-
mltt](https://github.com/brendanzab/rust-nbe-for-mltt)). I'm hoping that once
I've done this I might eventually be able to start looking at implementing
something to do with borrow checking in it, but who knows! The more I learn
the less I seem to know! Always interested in chatting to people about this at
our Gitter channel: [https://gitter.im/pikelet-
lang/Lobby](https://gitter.im/pikelet-lang/Lobby)

> Idris is perhaps the most famous dependently typed language.

I'd probably put Coq and Agda ahead of Idris in terms of being well known and
established, but Idris is certainly pretty cool in how it tries to target
practical programming.

~~~
iamrecursion
A good foundation for such a language would be one based on Quantitative Type
Theory [0]. It’s a dependent type theory that records usage information in
every typing judgement.

The Idris successor, Blodwen [1] is being based on it.

[0] [https://bentnib.org/quantitative-type-
theory.pdf](https://bentnib.org/quantitative-type-theory.pdf) [1]
[https://github.com/edwinb/Blodwen](https://github.com/edwinb/Blodwen)

~~~
bjz_
Yeah, I'm aware of Quantitative Type Theory, it's very cool! Another neat
iteration is described in "Resourceful Dependent Types"[0]. I'm interested in
what the Granule people are doing though - they can track usage information at
the type level too. It's still non-dependent for now, but I hear that they are
interested in extending it to dependent types too. They use an SMT solver to
track usage information which is really neat - apparently it allows to track
more interesting usage patterns than Blodwen can.

Sadly this doesn't do everything I want though - AFAIK, you can still have
multiple out-standing references in linear typing [1]. I'd really like some
story for uniqueness too in order to have support for in-place updates while
avoiding a GC.

[0]:
[http://www2.tcs.ifi.lmu.de/~abel/talkTYPES18.pdf](http://www2.tcs.ifi.lmu.de/~abel/talkTYPES18.pdf)

[1]:
[https://en.wikipedia.org/wiki/Uniqueness_type#Relationship_t...](https://en.wikipedia.org/wiki/Uniqueness_type#Relationship_to_linear_typing)

------
krcz
Languages I'd like to write:

* a language with a mix of contracts and refinement types: encoding preconditions and postconditions in types of input and output values. this way one can match postconditions of one function and precodnitions of the next. but programmer wouln't have to prove everything: the checks could be run-time or disabled overall, enabled just for testing, which could replace unit tests - asserting all conditions for example inputs would be enough,

* a language with possibility of restricting computational model per subroutine. not everything requires Turing completeness. orthogonally, most functions can be pure. the goal would be to stick to simpler models if you can and only use more complex one in small part of the codebase,

* a language with possibility of user defined linear types (/ affine types / relevant types), e.g. make it possible to require having every exception logged as an error, unless explicitly ignored,

* a language designed to be translated into other languages with the translation being readable code (in contrast to CLJS, ScalaJs, etc.), as idiomatic as possible; e.g. translating map / filter chains to loops when translating to imperative language.

This might be as well one language, but as complexity rises exponentially, it
might be better to start with few smaller ones instead.

~~~
ellius
Love bullet #2. Being able to start with more constrained features and using
more powerful techniques when necessary would be a huge aid in developing good
architectures.

~~~
nn3
Don't we already have that to some degree in GNU C?

gcc has an __attribute__((pure)) (not sure if it enforces it though) and there
are C++ constexprs.

~~~
np_tedious
I think it's a compiler hint for optimizations, but the onus of correctness
(ie. Is this really pure) remains on the programmer / whatever generates the C
code

------
cwp
Ooh. Dependent types and borrow checking. Yes please.

I'm into tools, so the weird language/environments I'd like to write include:

* A language where the program is constructed by editing a running process in-place with a debugger/IDE, then the process is "saved" as an executable.

* An iPad app that lets people draw dataflow programs with a pencil

* A SQL dialect that compiles to Kinesis streams and EC2 instances

~~~
mhluongo
> A language where the program is constructed by editing a running process in-
> place with a debugger/IDE, then the process is "saved" as an executable.

It's been a few years, but this reminds me of learning Smalltalk back in the
day, as well as how some Lisps (CL?) treat the VM as the program being
produced

~~~
protomyth
I knew a couple of Smalltalkers that would write their programs in the
debugger. Its pretty good for rapidly figuring out what you need to get the
job done, and then they would go back with the refactoring browser to clean it
up and get it in line with the rest of the system.

~~~
barrkel
This is generally how I write Ruby, using pry.

------
PorterDuff
Since I've mostly lost interest in computer science, my goals are much more
modest.

I think I'd like to pound out a language that succinctly describes sheet
music. I've seen at least one, but I think I could do a better job. The
toolkit would probably include a realtime display showing the results of the
interpreter in order to avoid a PITA save_file/convert_file/look_at_output
cycle.

This would be especially useful on smaller projects like leadsheets.

~~~
c256
Have you seen Lilypond? [http://lilypond.org/](http://lilypond.org/)

~~~
PorterDuff
I've tried it before, but ended up with MuseScore for everything.

What I'm thinking about is more like this:
[http://www.arkkra.com/](http://www.arkkra.com/)

A problem I see in music scoring software is that they are waay to
complicated. You end up with all the possibilities in that world even when you
just need a few features in your own corner.

What I'd like would be a way to really efficiently do a jazz leadsheet like
you'd see in a fakebook. That cuts the notation down quite a lot. The idea is
that you could type in something from an existing sheet really quickly in
order to do things like edit it or change the key...or you could bang out
something from transcribing.

Spend some time getting it to have a good handwritten look on output.

After that, add just enough stuff to do big band (or small group) charts. But
no more.

------
c3534l
I've always liked the idea of a language that combined syntax level support
for functional reactive programming and symbolic programming. So you define z
as x + y. Then you change the value of x and that change cascades across your
program, like a spreadsheet almost.

~~~
geocar
k/q does this. They're called views[1]

    
    
        z::x+y
        x:42
        y:42
        z
        y:69
        z
    
    

[1]: [https://code.kx.com/v2/ref/view/](https://code.kx.com/v2/ref/view/)

~~~
repsilat
And JS :-).

    
    
       let x = ()=>42
       let y = ()=>42
       let z = ()=>x()+y()
       z() // 84
       y = ()->69
       z() // 111

~~~
geocar
Not exactly the same thing, for one these aren't function calls, and for
another the view is memoized: You can see the difference with some print
statements:

    
    
        q)z::show(x;y;x+y);x+y
        q)x:42
        q)y:42
        q)z
        42 42 84
        84
        q)x:69
        q)z
        69 42 111
        111
        q)z
        111
    

Views are also _aware_ of what's changed:

    
    
        q)a:1234
        q)z
        111
        q)y:69
        q)z
        69 69 138
        138

------
brabel
> A python-esque language with algebraic data types

I think [Pony]([https://tutorial.ponylang.io/types/type-
expressions.html](https://tutorial.ponylang.io/types/type-expressions.html))
is close to being that (but it has much more, like Actors and reference
capabilities).

~~~
jarcane
“Python-esque with ADTs” is exactly what I loved about F# when I first found
it.

Unfortunately, the tooling is just as much of a nightmare (though with the
dotnet CLI it is slowly showing signs of improvement), and cross compatibility
is still iffy for a lot of things, so I’m not sure it satisfies the rest of
the author’s specs.

I would kill to see a dialect of F# completely freed of the .net nightmare and
allowed to fly free on its own.

~~~
0815test
What about Ocaml/ReasonML?

~~~
jarcane
Ocaml is ok, but coming from F# it feels just clunky enough to be noticeable,
as if you’re using some early pre-release version version of F#, which in a
way yu are, since F# started out as just a port of it. Adopting a light-ish
syntax similar to F#’s helped, but there’s still a sense it isn’t as polished
for public consumption, and the tooling is no less painful while also being
almost hostile to Windows users. :(

Bucklescript-TEA was kind of nice though, getting to play with the Elm
architecture but with a more flexible type system and better inference. But I
found the size of the bundles and tools and the slowness in the environment I
was using it in made me just go back to Elm instead. :(

As for Reason ... well ... Facebook has taken over webtech with a lot of
halfassed misunderstandings of better technologies, but this one might take
the cake.

I honestly find that whole project insulting, and so should you. It’s as if
they’ve declared JavaScript developers to be so stupid that they physically
can’t use a language with any other syntax, so they have to fuck up one to get
them to use it.

~~~
ernst_klim
What don't you like about OCaml tooling safe opam's absence on windows (well,
technically it could be built, but still unofficially)?

------
pdamoc
What I would love to see is a declarative object oriented language. It would
marry the idea of FauxO from Gary Bernhardt's Boundaries talk [1] with the
syntax of Elm.

Elm already allows for escaping into other languages. I would love to see that
mechanism expanded and a bunch of "core" DSLs implemented using ideas from the
"STEPS Toward the Reinvention of Programming" [2].

[1]
[https://www.destroyallsoftware.com/talks/boundaries](https://www.destroyallsoftware.com/talks/boundaries)
[2]
[http://www.vpri.org/pdf/tr2012001_steps.pdf](http://www.vpri.org/pdf/tr2012001_steps.pdf)

------
zebproj
> I spent this weekend writing a Forth designed for music synthesis

I'd be very curious to learn more about this project. I've been building these
myself [0] for a few years now.

[0]
[https://paulbatchelor.github.io/proj/sporth.html](https://paulbatchelor.github.io/proj/sporth.html)

------
azhenley
A programming language that is designed to be spoken. It could be great for
those with disabilities.

~~~
setr
Urbit defines pronunciations for all of its sigils with the goal of enabling
verbal communication of its forms; however, it makes no attempt to be sensible
language, its more of just random english syllables that compose without too
much harshness, justified by the use of greek letters in mathematics (part of
their value is they have little/no context to bring in, so you can freely
build your own)

~~~
thanksDr
I look forward to seeing what we learn from urbit ten years from now. 0=true?
Crazy sigils, three ways?

I just went back to their website to remember the special name they used for
distributed computation, and they have introduced /even more new words and
layers!/ Godspeed, you.

------
vanderZwan
> _An effect system for Forth_

I have to confess that I don't know what exactly entails an "effect system",
but Kitten trying to achieve something like that?

[http://kittenlang.org/](http://kittenlang.org/)

~~~
chriswarbo
An effect system is like a type system, but keeps track of the 'effects'
(think 'side effects', but we're doing them on purpose) that may occur when
evaluating an expression. For example `print` might have a `log` effect.
Unlike types, which get 'consumed' (e.g. by calling a function with an
argument), effects tend to accumulate.

I've mostly seen effect systems in the form of 'algebraic effect handling',
which allow effects to be "handled" in a similar way to try/catch for
(resumable) exceptions. For example, if we have an expression with the `log`
effect, our tests might wrap it in a handler which just accumulates a string,
so we can test what was logged; our production system might use a handler that
plugs into an external logging system (which would require an effect like 'IO'
or 'socket' or something).

Stack languages like Forth and Kitten have "stack effects", which are the
effects that evaluating an expression has on the stack, e.g. popping some
values.

Effects are sort of the inverse of capabilities: an expression with effect E
tells us "evaluating this expression might result in E happening", whilst an
expression with capability C says "to evaluate this expression, you must allow
me to C".

------
notacoward
The language I want to write would have built-in support for the flow of
control within a single function to flow seamlessly across multiple
processes/machines. I don't mean fancy RPC. That still requires the programmer
to break up the parts that run in different places into separate functions and
callbacks, define the arguments that get passed between them, etc. I mean the
compiler knows about the notion of a "place" and which data exists in each
place. When it hits an "on (place)" construct it can figure out what needs to
be passed, handling it for you between one line and the next. Fuller
explanation here:

[http://obdurodon.silvrback.com/distributed-
functions](http://obdurodon.silvrback.com/distributed-functions)

This doesn't completely free the programmer from worrying about distributed-
programming concerns such as node failure and broken connections. Nothing
will. However, the fact that the flow of control and data looks like that of a
local sequential program would make such code easier to write, test, and
formally verify. I see a _lot_ of bugs in the distributed systems I work on
that occur because the low-level mechanisms are so intrusive that programmers
can't (or just don't) test or verify the higher-level behaviors.

~~~
7373737373
Have look at the
[https://en.wikipedia.org/wiki/E_(programming_language)](https://en.wikipedia.org/wiki/E_\(programming_language\))
!

------
jodrellblank
One with no errors. There's no concept of a "syntax error" or a "compiler
error" or a function error. One of the most common things we joke about is
people not reading error messages.

Whatever the design is, it would not ever spit a big red blob in your face
which makes you wince and feel bad, nor would it fill your terminal - the
place where you work - with screen after screen of tracebacks. It is
unthinkable that you could write "x-1 = x+1" on a piece of paper and the
equation scribbles on your workplace and you can't use it anymore.

There would be no adversarial relationship, you wouldn't be "fighting" the
compiler or the borrow checker, no red squiggly underlines in an IDE. The
whole approach would be reframed into the computer being a mechanical
assistant helping you solve problems and guiding you _towards success_ instead
of slapping you.

A tuning fork plays a tone you can use to tune a piano string. It doesn't slap
you if tweak the string tuning the wrong way. An archery target lets you see
when you miss the centre, it doesn't also shout at you. Code _not working_ is
feedback all by itself. The tools shouldn't add negative feedback to that,
they should guide towards where working is.

~~~
Athas
Do you have a concrete example of how this would work? If I write some garbage
and ask the computer to run it, what should happen?

I think term rewriting languages are close to this idea, in that if you write
something that is not a redex, it just stays the way it is. I've never heard
anyone describe this as particularly ergonomic or friendly however, as it can
be hard to figure out why nothing is happening. It also severely constrains
the language design.

~~~
v_lisivka
> If I write some garbage and ask the computer to run it, what should happen?

You will be pushed. J

Seriously talking, if I need to wrote error checking code with user visible
message, usually I'm trying to add a suggestion to user how to resolve
problem. It's good UX.

------
yxhuvud
He wants a python with algebraic data types? I wonder if he has looked at
Crystal. Itis neither, but still perhaps close enough. Ruby espressabilty and
a type system that while probably not powerful enough to be classified as
algebraic, still is powerful enough to have things like sum types.

------
tech2
Something with jq's filtering (and likewise JMESPath) and output for stream
processing could be quite interesting indeed.

In terms of my own pet desires for a language I was always a little sad that
the iteration constructs from ICSI's Sather didn't see more love.

------
pjc50
My own personal list:

\- Verilog replacement with composite types, explicit state/functional
separation and pipelining assistance

\- "English like" language designed with reading aloud in mind

\- typesafe macro assembler with memory safety assistance

~~~
fanf2
How close is bluespec to your thoughts on a verilog replacement? eg
[https://www.cl.cam.ac.uk/research/security/ctsrd/beri/](https://www.cl.cam.ac.uk/research/security/ctsrd/beri/)

~~~
pjc50
That looks promising on initial inspection of e.g [https://github.com/CTSRD-
CHERI/beri/blob/master/cheri/trunk/...](https://github.com/CTSRD-
CHERI/beri/blob/master/cheri/trunk/DCacheClassic.bsv) , although possibly a
bit more imperative than I had in mind - still has for(). If I was working on
HDL commercially I'd definitely give it a deeper look.

------
nwmcsween
Regarding language #1:

* some form of resource awareness like raml.co.

* a cli tool to compute resource awareness based on args provided, e.g. `ra --mem On, --time O1 file.ex file2.ex file3.ex` that all implement a single interface.

~~~
7373737373
I'm building
[https://esolangs.org/wiki/RarVM](https://esolangs.org/wiki/RarVM) \- wanna
join? :)

------
protomyth
I still think a decent Agent Oriented Language is possible. Something that
takes into account proper agent communication and is not just a Smalltalk
variant or a Java framework.

~~~
pjmlp
You just reminded me of Agent Tcl.

[https://www.cs.dartmouth.edu/~dfk/agents/papers/kotz:jmobile...](https://www.cs.dartmouth.edu/~dfk/agents/papers/kotz:jmobile.pdf)

~~~
protomyth
I thought Agent Tcl was about half way there. It just felt like the
infrastructure didn't quite get over that hump that would have allowed it to
be a success. I do admire the effort.

~~~
blacksqr
AGNI: a multi-threaded middleware for distributed scripting (2000)

"We present the design of a AGNI a Tcl 8.1 based Middleware for building
reactive, extensible, reconfigurable distributed systems"

[https://www.semanticscholar.org/paper/AGNI%3A-a-multi-
thread...](https://www.semanticscholar.org/paper/AGNI%3A-a-multi-threaded-
middleware-for-distributed-Bednarek-
Pors/cecf246d2fe4fb428490039f557f157ad716ef10)

------
IshKebab
A sane shell language would be nice. Powershell is closer than most, but it
still has some pretty WTF aspects, like `-lt` instead of `<` and how lists
collapse.

~~~
v3gas
Check out Oil! [https://www.oilshell.org](https://www.oilshell.org)

------
snrji
Noob question: don't dependent typing requires the language to be dynamic? How
do you check dependencies in types otherwise (eg. the size of an array)?

~~~
miloignis
If I understand your question, generally the compiler would use a theorem
prover / SAT solver to prove that the constraints of the dynamic types were
always upheld. If it can't, in some languages this is a compiler error. In
others it will introduce runtime checks (but this still doesn't require a
fully dynamic language, as such, but it is in a sense partially dynamic).

------
marklemay
ATS seems relevant, it has dependent types and linear types. My understanding
isthat linear types have a lot in common with barrow checking.

------
tobr
I would like to make a lightweight markup language for text and data, with
some concept of possible future revisions. So when you try to commit a new
revision of a file, it could automatically be verified as a valid edit of a
specific previous revision.

------
a_imho
_What programming languages do you want to see?_

A programming language focused on usability, along the lines of
[https://news.ycombinator.com/item?id=19478086](https://news.ycombinator.com/item?id=19478086)

~~~
zoul
Elm (elm-lang.org) does some of that.

------
FrankHB
I'd like to continue to develop something based on vau calculi with some forms
of partial evaluators, since I have lost interest in type theories.

------
ncmncm
Am I confused, or is Wesley?

C++ supports dependent types:

    
    
      template<typename T>
      T add(T, T);
    

C++ doesn't have borrow checking. Maybe he means no non-obligate-GC language
has dependent types _and_ borrow checking?

~~~
TheAsprngHacker
As net4all pointed out, your C++ example isn't really dependent types. It's
achievable with parametric polymorphism a la System F, AKA the ML-style or
Java-style generics.

C++ does have value arguments for templates, however. Perhaps a better example
would have been std::array, which takes a size as an argument.

However, C++ still doesn't really have dependent types the same way Agda or
Idris has them. One big difference is that C++ templates are only checked upon
instantiation. So, this code:

    
    
        template<typename T, T a> std::array<int, a + 1> add()
        {
            return {1, 2};
        }
    

compiles, but when I try to do

    
    
        add<int, 0>()
    

the compiler complains. Because the dependent function type means "forall,"
it's important that the compiler make sure that it truly does work _for all_
inputs.

~~~
pjmlp
As of ISO C++20 that is no longer true, if the template makes use of concepts.

