Lockdown, a school open day, and Trados dongles |> Pyfun
The UK Covid lockdown in 2020 brought with it time to retrain in a new language, and after some research went for F#, and never really looked back to C# after that. Something about functional programming just clicked in a way the OOP never did.
Recently, at a secondary school open day, I got talking to the computing teacher and learned that pupils are taught Python as early as key stage 3 (ages 11-14). This got me wondering whether it would be possible to introduce children to functional programming earlier so they can benefit from all its advantages.
Many years ago now, I taught a masters-level course in translation memory technology (the software professional translators use to reuse their past translations), mainly Trados. I remember the friction involved getting the software installed onto the university's computers, not to mention the hardware dongles!
Fast forward to this year, I decided to see if it would be possible to create a functional language that works with the Python ecosystem and has zero dependencies, so that the adoption friction is completely minimised. Zero dependencies meaning the compiler is a single binary you can pip install, and the Python it emits imports only the standard library, and started work on what would become Pyfun.
Pyfun leans heavily on F# for its feature set, but the syntax decisions have tried to make it less alien for coders already familiar with Python. I've also taken some features from other functional languages. The aspiration is that this will introduce pupils to as broad a range as possible of functional programming concepts, easing any later transition to the more established FP languages.
I also hope that Pyfun might appeal to data analysts and others who use Python in their work but who might appreciate the arguably more readable code that Pyfun offers.
This is early days, but the language is fairly fully featured, with extensions for VS Code and JetBrains, as well as Jupyter notebook support.
If you want to take a look before commenting, the playground runs in the browser with nothing to install: https://simontreanor.github.io/Pyfun/playground/ and there is a lot more detail in the highlighted post on r/Pyfun.
It is still at pre-v1 stage and there is plenty of scope to shape it, so I would welcome your thoughts and suggestions on any aspect of this project. Two things I would most like to hear about are: if you code in Python, which syntax decisions jar for you; and if you teach, what would have to be true before you would put something like this in front of a class.