5 ms·
When I was teaching Prolog are the university, I always introduced it as a niche language. “Prolog makes you unbelievably fast at very specific tasks, but don't
by radomir_cernoch 4y ago
When I was teaching Prolog are the university, I always introduced it as a niche language. “Prolog makes you unbelievably fast at very specific tasks, but don't try to implement a web server in it.”
I was so wrong! :-D
- linkdd 4y agoWell, a CGI script isn't really a web server.
- Avshalom 4y agoalthough there's certainly nothing stopping you from writing a server https://github.com/SWI-Prolog/packages-http https://github.com/SWI-Prolog/packages-http https://github.com/ciao-lang/ciao/tree/master/core/library/http https://github.com/ciao-lang/ciao/tree/master/core/library/h... https://github.com/mthom/scryer-prolog/tree/master/src/lib/http https://github.com/mthom/scryer-prolog/tree/master/src/lib/h...
- drbojingle 4y agoWhat tasks is it really good for?
- eyelidlessness 4y agoDefine a model of your program’s state, as if you’d define a model in a database. There, that’s your program! It is actually a database. You can’t create invariants in the program. It’s entirely defined by how you modeled it. Your program is correct.
- tannhaeuser 4y agoStraightforward searching through combinatoric spaces for planning and optimization, including robotic and eg. discrete investment planning for models where solutions can't be described by a finite number of variables (see [1] for in-browser container logistics planning). Composition of programs with complex rule-based semantics and large specs (the Prince CSS renderer is written in Mercury). Diagnostics, capturing legal, medical, and other taxonomic knowledge in executable form, possibly as implementation, extension, or replacement for semantic web stuff and description logic. All of the above with easy and powerful DSL capabilities ranging from built-in customizable operator precedence parsing, over natural recursive descent parsing with backtracking, to attribute grammars and arbitrary logic (Prolog started out as a 70's natural language understanding approach employing logic grammars). [1]: https://quantumprolog.sgml.io/ https://quantumprolog.sgml.io/
- mncharity 4y agoIIRC (it's been years), a highly-conformant Perl5/Perl6/python/javascript regex engine core in SWI Prolog was concise and performant. Like "wow, it just one short file" concise. And "KISS competitive-with-little-optimization" performant. Modulo memory halo. IIRC, far more effort went into bootstrapping grammars and creating testing infrastructure. It helped warped my perspective on how concise and pretty compiler guts could/should be.
- astrange 4y agoMercury, which is Prolog inspired, is actually a very interesting underrated language! I think languages need to lean harder in the direction of doing more with functions than just evaluating them. Unification is one example, but you can imagine more.
- jamesfisher 4y ago> you can imagine more My imagination is failing me! Can you give more examples?
- ragebol 4y agoDifferential computing comes to mind. Kinda like prolog in that you can run a function in reverse.