Look at your favorite programming language and identify the little functional logic languages embedded in it (meaning: backtracking evaluation with unification to find unknowns). JavaScript, C#, and Java have one for regular expressions.
-
-
Fortunately, most languages already have the low-level plumbing mechanisms to implement functional logic: futures (variables that can be unified), coroutines (for separating value production from consumption), and exceptions (for failing back to a join.)
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
The Icon programming language is worth revisiting, as it was able to do (cross function) backtracking in an imperative setting, allowing some very terse control structures. I implemented it once, can be pretty fast too, see https://dl.acm.org/citation.cfm?id=914441 … (sorry no non-acm link)
-
That's nice! Using declarative backtracking and choice to consume and produce containers is super expressive.
- 1 more reply
New conversation -
-
-
Prolog is actually the language built on unification and backtracking, but it is hard to tell whether it makes more sense to use it as a sub-language or on its own.
-
Mercury and Curry are functional logic languages which are a lot closer to normal programming practice. If you know how to map Haskell to the C family, then you'll find these pretty straightforward.
- 1 more reply
New conversation -
-
-
Check out Rust’s Chalk: https://github.com/rust-lang/chalk Long-term goal is to replace the type checker with a Prolog-like interpreter, and package Chalk independently for others to use as well.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Oz / Mozart has this, per CTMCP, which is where I learned it (although I guess I could have learned it from Prolog). Honestly, it seems mostly useful for programming competitions problems (so much bounded combinatoric search!) and Sudoku solvers.
-
General computation over types / generics is actually a distinct language direction, and I personally don't think it's a fruitful avenue. It makes tooling really hard, tends towards macros in creating inscrutable write-only libraries, and generally harms scaling up a team.
End of conversation
New conversation -
-
-
What part of this requires a language feature? Many people already prefer to write regex with a library with a builder pattern instead of writing the string so what's wrong with the library approach to the problem?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I’ve always wondered when you’re going to retire to a professorship lecturing on the principles and concepts of programming languages. Those leather elbow patch sweaters would suit you well
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.