r/haskell • u/d1r3w00lf • Apr 28 '23
A Block-Based Functional Programming Language
Hi All,
Im a Univeristy Student currently studying Computer Science at the University of Southampton, and as apart of my Dissertation / Thesis i have created a proof-of-concept tool that combines ideas from the Functional Language Haskell with the Block-Based visual paradigm.
Ive spent alot of time and effort on this project, and whilst i havent managed to achieve all my goals, im still proud of its outcome and am here to share it!
You can find the project at https://blockell.netlify.app/, where you can create small programs using blocks to declare functions and generate haskell code. Unfortionately, there are no tutorials for the tool, and to run the code you have to copy it into a haskell file and run it locally on your machine. :(
Anyways, if you like the tool, or have any comments, suggestions or improvements feel free to comment them below or answer this anonymous feedback form here: https://forms.office.com/e/nd6sJ3Gq0U
Any and all commments with be tremendous help to my project, but also Im just proud of this language and want others to see it :)
21
u/cdsmith Apr 28 '23
If you're interested in a similar project from the past, check out https://code.world/blocks, which was build by Stefan Jacholke in 2016 as part of Summer of Haskell. One interesting thing Stefan did was to vary the shape of a connector to represent its type, so ill-typed expressions just don't fit together! Unfortunately, this required building on a fork of Blockly, which has been a bit of a nightmare to keep running... in fact, it's rather buggy now, and you might need to reload a few times to get the block tray to appear.
12
u/day_li_ly Apr 28 '23 edited Apr 28 '23
Seems like an interesting project! Several minor problems:
_for unfilled slots).++block can appear in pattern position, which seems like a bug5
u/ApothecaLabs Apr 28 '23
This is a wonderful effort! Don't be afraid to show what you're working on, even if it is still in progress.
If I might suggest:
map (\x -> x + 1)instead ofmap (+1)map "notafunction" ...ornot (\x -> ...)I also managed to get a few blocks into an uneditable / unrecoverable state - it broke the code generator until I restarted the page - I'm not sure exactly what I did to cause this.
3
u/Greenscarf_005 Apr 28 '23
interesting project! do you plan to open source it?
1
u/Tayacan Apr 28 '23
This is cool! Bug report:
I tried to implement a sum function - those blocks generate this code:
If I change 0 to 1, the number appears in the generated code, but if I change it back to 0, it disappears again.
2
u/Various-Outcome-2802 Apr 29 '23
You could submit a pull request to get it added to awesome-structure-editors by /u/yairchu
1
u/Glittering_Wealth522 Jun 18 '25
This speaks to me right now. I'm literally making a show about block coding characters and I want a place to write and run my Syntax for my show. I just can't find any good places
2
u/[deleted] Apr 28 '23
[removed] — view removed comment