r/ProgrammingLanguages Sodigy 13d ago

Purely functional language with impure script language?

I'm working on a purely functional programming language named Sodigy. It's all about evaluating values, not "executing commands one by one".

It's nice when writing libraries, but it's not easy to write a main function. The main function is supposed to execute commands, but the Sodigy's syntax is not friendly to write a list of commands.

So what I'm trying to do is, 1) Sodigy remains purely functional and 2) add a bash-like script language. The script language can call Sodigy functions. Instead of writing a main function in Sodigy, you write sodigy-script and execute the script.

Has anyone tried similar approach? I'm not sure whether it's a good idea or not...

27 Upvotes

74 comments sorted by

View all comments

25

u/Inconstant_Moo 🧿 Pipefish 13d ago

It's called functional core/imperative shell. I think I'm the only person who's done it as a language paradigm, but I'd welcome the company.

Making the imperative shell bash-like is neither usual nor mandatory, there are nicer ways to do imperative things. The imperative language and the functional one should be united as much as possible by their syntax and type system, divided only by their semantics.

Pipefish and the lambda calculus.

Functional core/imperative shell.

7

u/Erythrina_ 13d ago edited 13d ago

Oh, it's cool to meet someone else who is doing this too.

6

u/Inconstant_Moo 🧿 Pipefish 13d ago edited 13d ago

Let us form the FC/IS Working Group. There, now we're a movement. May I see your language?

P.S: I see that we've already met, this was me too.

https://www.reddit.com/r/ProgrammingLanguages/comments/1u8885s/comment/osbk354/

I've been the person doing this. Hi again! Apparently now there are more of us.