5 ms·
Well, luckily what prolog screams is irrelevant. Most programming language are Turing complete and if so they're also general purpose by definition. You can us
by ausudhz 4y ago
Well, luckily what prolog screams is irrelevant.
Most programming language are Turing complete and if so they're also general purpose by definition. You can use them to build anything.
That said of course our definition might be different and if you don't have plenty of layers of abstraction that speed your development you won't consider that programming language compared to another.
After all, we are running JavaScript in the servers now and you can find an npm module for nearly everything. Probably someone 20 years ago would've said that "JavaScript is not a general purpose language"
Don't get me wrong, prolog may never be the next JavaScript, but is just fun how people would define something is "general purpose" or not (no hate, just a pure comment seeing things from a different angle)
- xupybd 4y agoI think many people understand general purpose to mean it's a good language choice for many different and common uses. It has little to do with how Turing complete the language is. Just how well it suits a variety of problem domains.
- eadler 4y agoagreed. For example C is considered general purpose despite not being Turing complete.
- bmitc 4y agoIs it really not? Do you have a reference for that? I can’t find anything that says C isn’t Turing complete.
- ogogmad 4y agoIt's a troll. But not wrong. C treats computer memory as an array of bytes indexed by a pointer type that can take only finitely many values. If the pointer type can be cast losslessly to `long int` - which is usually understood to be 64 bit - then this byte array has precisely 2^64 entries. That implies that C programs have an absolute limit on the amount of memory they can use (2^64 bytes). That's obviously true, because each call to `malloc` fills up another entry of this finite byte array. C therefore can't simulate a Turing Machine, because a Turing Machine can use an unbounded amount of memory. If you use a file system, or another source of external memory or storage, then the above argument no longer applies.
- avmich 4y agoA long time ago computers with limited RAM address space - and problems which didn't fit - used various tricks to deal with that. Overlays, paged memory, virtual memory - all that could effectively address more memory than address space allows. So I'd argue C-as-specification (not as existing implementation, I don't know) is _theoretically_ Turing complete. Yes I agree it's a troll.
- Jorengarenar 4y agoIn strict sense of being Turing-Complete, noting is TC, because of physical world limitations (infinity doesn't really exists). If we use "useful" definition of being Turing-Complete, then even `printf()` alone is already TC.
- ausudhz 4y agoI think C is Turing complete for sure.
- naasking 4y ago> For example C is considered general purpose despite not being Turing complete. Actually, C fails the general purpose language criterion too, because it's simply not a good choice for many different and common uses. It's a good choice for very specific uses at this point.
- cultofmetatron 4y agoc is only technically not Turing complete because it runs on real machine with finite memory. by that definition, no programming language is turing complete.
- bmitc 4y ago> Most programming language are Turing complete and if so they're also general purpose by definition. You can use them to build anything. How long do you think it would take to write a web server in Rule 110? https://en.m.wikipedia.org/wiki/Rule_110 https://en.m.wikipedia.org/wiki/Rule_110 Turing completeness is an interesting theoretical concept, but it is wholly unsuitable and largely irrelevant when discussing the usefulness of programming languages.
- YeGoblynQueenne 4y agoWhat is "usefulness" then? It's clear that different programming languages are more suitable for different use cases, for example one wouldn't normally script a browser in Lua or use Javascript to write a driver for a hardware device. That said, if it's about use cases, Prolog is an excellent language for web development and capable of replacing most of the usual mixed OOP and relational stack. For example, the SWI-Prolog website runs on SWI-Prolog's own http libraries. Quoting from https://www.swi-prolog.org/dogfood.html https://www.swi-prolog.org/dogfood.html: This page presents a brief history of hosting and developing http://www.swi-prolog.org http://www.swi-prolog.org. The website runs SWI-Prolog and is basically `PlDoc, the SWI-Prolog source documentation system on steroids'. This site replaced a classic Apache server built from static documentation pages, a Twiki-based wiki and Bugzilla. The site was re-implemented as a SWI-Prolog-based HTTP server that extends PlDoc for the following reasons: 1. PlDoc unites the core reference manual with the package documentation and documentation extracted from all loaded sources in a coherent interface. In addition, it provides search, dynamically generated hyperlinks between the various pieces of documentation, and display of the source code. This is far better than the fragmented and not properly interlinked static documentation of the old site. 2. SWI-Prolog comes with extensive libraries for providing web services. Running the website on the system is just the ideal opportunity to test these services and prove to the Prolog community that they are a vital piece of the infrastructure and that we trust them. The server: welcomes about 4,000 visitors each day, viewing about 30,000 pages (120,000 hits) (2013) serves about 350 Gb of data per month serves downloads from static files serves manual pages from on-the-fly post-processed HTML documents serves dynamically generated HTML pages from documented source files, coloured source files, etc. analyses, indexes and presents packs. It also presents the meta-data for pack_install/1 runs a REST API to handle user annotations. Also see: Can I replace a LAMP stack with SWI-Prolog? https://www.swi-prolog.org/FAQ/PrologLAMP.txt https://www.swi-prolog.org/FAQ/PrologLAMP.txt