News for hackers. Stuff that matters.
Re:Why do our programs need to read input and write output? by Gabriel439 on Sunday October 08, 2017 @01:22PM (#15429045)
In Dhall's case it is a typed interpreter. So every time you interpret an expression there are three phases:

* Resolve all imports (transitively, if necessary)

* Type-check the code

* Normalize the code (a.k.a. evaluation, but it can normalize functions, too)

It's a little more complex than that (for example, imported code is itself type-checked before substitution into the syntax tree), but that's the basic idea

It's closer in spirit to a Bash script sourcing another bash script (i.e. using "source"). However, the difference from Bash is that:

* In Bash the unit of code composition is statements (as opposed to expressions in Dhall) * When you source another script you can only do so at the top-level of the program, as a statement (as opposed to Dhall where you can import other expressions anywhere within the syntax tree)

I'm less familiar with PHP so perhaps somebody who knows it better can explain how Dhall relates to the PHP model

Re:Why do our programs need to read input and write output? by maxxxxx on Sunday October 08, 2017 @01:43PM (#15429121)
Look into .NET. You can do the same thing with C# by compiling and loading it dynamically.