_____ _ |_ _| |_ _ _ _ _ | | | ' \ || | ' \ |_| |_||_\_,_|_||_| Thun "...as simple as possible, but no simpler." A dialect of Joy. Version -10.0.0. (Version -10 in case I want to change the names of some functions before the first "real" release, and I'm more-or-less using https://semver.org/ ) This project started life as part of a Python project called at first Joypy but then later renamed (after someone claimed the name on PyPI before me) to Thun in honor of Manfred Von Thun who created Joy. While creating a type-inference system for it I realized that it would be much easier and more flexible to do it in Prolog. In fact, the Prolog code (using SWI Prolog) is so much more elegant than the Python version that, combined with the recent deprecation of Python 2, it convinced me to switch "whole-hog" to Prolog. (You can find the original project at: https://joypy.osdn.io/ ) ___ _ ___ _ | __|_ ____ _ _ __ _ __| |___ / __|___ __| |___ | _|\ \ / _` | ' \| '_ \ / -_) | (__/ _ \/ _` / -_) |___/_\_\__,_|_|_|_| .__/_\___| \___\___/\__,_\___| |_| Here is an example of Joy code: [[[abs]ii <=][[<>][pop !-]||]&&][[!-][[++]][[--]]ifte dip][[pop !-][--][++]ifte]ifte It might seem unreadable but with a little familiarity it becomes just as legible as any other notation. Some layout helps: [ [[abs] ii <=] [ [<>] [pop !-] || ] && ] [[ !-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte ] ifte This function accepts two integers on the stack and increments or decrements one of them such that the new pair of numbers is the next coordinate pair in a square spiral (like the kind used to construct an Ulam Spiral). For more information see docs\notes\on-square-spiral.md ___ _ _ _ _ _ | __| _ _ _ __| |_(_)___ _ _ __ _| (_) |_ _ _ | _| || | ' \/ _| _| / _ \ ' \/ _` | | | _| || | |_| \_,_|_||_\__|\__|_\___/_||_\__,_|_|_|\__|\_, | __ _ _ _ __| | | _ \_ _ _ _ _ __ ___ ___ |__/ / _` | ' \/ _` | | _/ || | '_| '_ \/ _ (_- cd source PS C:\Users\sforman\Desktop\src\PROLOG\Thun\source> swipl thun.pl Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.4-33-gf5970a6e0) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit http://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). 1 ?- Creating a better user interface is a big part of the "meta-project" here, if you will. Thun/Joy is the language, the UI is the real project. I'm thinking a server with multiple clients (web, native) just because Prolog isn't fabulous at the nitty-gritty of UIs. There are other logic languages that have e.g. reactive rules. Kowalski has a great thing: LPS (Logic Production Systems) http://lps.doc.ic.ac.uk/ Anyhooo, for now there's not even a REPL. Use Prolog's. TODO: Explain the top-level predicates, with examples, this can be put in the docs directory... ___ _ | \ _____ _____| |___ _ __ ___ _ _ | |) / -_) V / -_) / _ \ '_ \/ -_) '_| |___/\___|\_/\___|_\___/ .__/\___|_| _ _ | \ ___ __ _ _ _ __|_|__ _ _| |_ __ _| |_(_)___ _ _ | |) / _ \/ _| || | ' \/ -_) ' \ _/ _` | _| / _ \ ' \ |___/\___/\__|\_,_|_|_|_\___|_||_\__\__,_|\__|_\___/_||_| Developer Documentation Since there aren't yet any user-facing clients this is pretty much all developer documentation. Until the UI side of the project is re-worked this will mostly be of interest to people who are into formal semanics of programming languages. If you already know Prolog then the code should be pretty simple and straightforward. The partial reducer is documented in "The Art of Prolog" so I won't repeat that here. Other than that there just really isn't anything to crunchy in there. The signal virtual of Joy is it's simplicity after all. Adding syntax should be avoided. At some point I'll likely add more types, and maybe subtype relations between them. Maybe add the ability to "tag" types from Joy itself (i.e. the ordered binary tree functions.) ___ _ _ _ _ _ / __|___ _ _| |_ _ _(_) |__ _ _| |_(_)___ _ _ ___ | (__/ _ \ ' \ _| '_| | '_ \ || | _| / _ \ ' \(_-< \___\___/_||_\__|_| |_|_.__/\_,_|\__|_\___/_||_/__/ Contributions Well, aren't you sweet! GPL, docs please, "Be excellent to each other." ___ _ _ _ ___ _ _ | _ )_ _(_) |__| | / __| |_ __ _| |_ _ _ ___ | _ \ || | | / _` | \__ \ _/ _` | _| || (_-< |___/\_,_|_|_\__,_| |___/\__\__,_|\__|\_,_/__/ Build Status No build, no status.