https://github.com/vygr/ChrysaLisp Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} vygr / ChrysaLisp Public * Notifications * Fork 85 * Star 1.4k Parallel OS, with GUI, Terminal, OO Assembler, Class libraries, C-Script compiler, Lisp interpreter and more... License GPL-2.0 license 1.4k stars 85 forks Star Notifications * Code * Issues 29 * Pull requests 1 * Actions * Projects 4 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights vygr/ChrysaLisp This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 3 branches 45 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/v] Use Git or checkout with SVN using the web URL. [gh repo clone vygr/C] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @vygr vygr Update VP_ASSIGNMENT.md ... 61cf775 Jan 12, 2023 Update VP_ASSIGNMENT.md 61cf775 Git stats * 6,690 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time apps Update install.lisp Dec 12, 2022 class remove guard page option Dec 14, 2022 cmd change t -> :t and nil to :nil Oct 1, 2022 docs Update VP_ASSIGNMENT.md Jan 12, 2023 fonts smaller CTF files Jan 20, 2020 gui Rework (env-resize num [env[) Dec 12, 2022 lib be explicit in what is returned. Jan 12, 2023 src switch to snprintf Jan 5, 2023 sys move *debug_emit* to the VP code emit stage. Jan 11, 2023 .gitignore Removal of unsupported source Sep 30, 2022 LICENSE Basic cut/copy/paste functionality and clipboard service (#201) Nov 17, 2020 Lisp.tmLanguage a few doc corrections Dec 23, 2022 Makefile no need now for empty folders Dec 21, 2022 Makefile_Homebrew no need now for empty folders Dec 21, 2022 README.md remove guard page option Dec 14, 2022 STATUS.md remove guard page option Dec 14, 2022 funcs.ps1 new GUI Terminal 2.0 ! Jun 12, 2021 funcs.sh new GUI Terminal 2.0 ! Jun 12, 2021 install.bat new GUI Terminal 2.0 ! Jun 12, 2021 run.bat launch scripts for TUI only Dec 24, 2020 run.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run.sh better option handling Mar 4, 2021 run_cube.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run_cube.sh better option handling Mar 4, 2021 run_mesh.bat launch scripts for TUI only Dec 24, 2020 run_mesh.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run_mesh.sh better option handling Mar 4, 2021 run_ring.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run_ring.sh better option handling Mar 4, 2021 run_star.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run_star.sh better option handling Mar 4, 2021 run_tree.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 run_tree.sh better option handling Mar 4, 2021 run_tui.bat new GUI Terminal 2.0 ! Jun 12, 2021 run_tui.ps1 Update run_tui.ps1 Apr 8, 2021 run_tui.sh better option handling Mar 4, 2021 screen_shot_1.png refresh screen shots Nov 3, 2020 screen_shot_2.png refresh screen shots Nov 3, 2020 screen_shot_3.png refresh screen shots Nov 3, 2020 screen_shot_4.png refresh screen shots Nov 3, 2020 screen_shot_5.png refresh screen shots Nov 3, 2020 screen_shot_6.png refresh screen shots Nov 3, 2020 screen_shot_7.png current GUI screenshot Nov 1, 2020 screen_shot_8.png add screen_shot_8 Aug 14, 2021 snapshot.zip Update snapshot.zip Dec 12, 2022 stop.bat split make in tui and gui options Dec 24, 2020 stop.ps1 latest Windows launch scripts from Mr Blyss Apr 4, 2021 stop.sh correct TEMP location for Macs ! Dec 21, 2022 View code [ ] ChrysaLisp Getting Started Make/Run/Stop Installing Make Run Stop Snapshot Clean README.md ChrysaLisp Assembler/C-Script/Lisp 64 bit, MIMD, multi CPU, multi threaded, multi core, multi user Parallel OS. With GUI, Terminal, OO Assembler, Class libraries, C-Script compiler, Lisp interpreter, Debugger, Profiler, Vector Font engine and more... [screen_sho] [screen_sho] [screen_sho] [screen_sho] [screen_sho] [screen_sho] [screen_sho] [screen_sho] It runs on MacOS, Windows or Linux for x64, MacOS or Linux for Aarch64. Will move to bare metal eventually but it's useful for now to run hosted while experimenting. When time allows I will be doing a VM boot image for UniKernel type appliances and a WebAssembly target to play around within the browser. You can model various network topologies with point to point links. Each CPU in the network is modelled as a separate host process, point to point links use shared memory to simulate CPU to CPU, point to point, bi directional connections. There is no global bus based networking on purpose. The usb-links branch has the ability to use a usb3/usb2 Prolific chip 'copy' cable to join heterogeneous host networks ! This demonstrates that the simulated peer to peer network on a single machine does actually translate to real world parallel hardware ! Plus it's rather cool to string your MacBook and Windows laptops together with your PI4's to create your own dev network. There is a virtual CPU instruction set to avoid use of x64/ARM/VP64 native instructions. Currently it compiles directly to native code but there is no reason it can't also go via a byte code form and runtime translation. Register juggling for parameter passing is eliminated by having all functions define their register interface and parameter source and destinations are mapped automatically using a topological sort. Non DAG mappings are detected so the user can break them with a temporary if required. Operators are provided to simplify binding of parameters to dynamic bound functions, relative addresses, auto defined string pools, references and local stack frame values. Unused output parameters can be ignored with an _. There is a powerful object and class system, not just for an assembler, but quite as capable as a high level language. Static classes or virtual classes with inline, virtual, final, static and override methods can be defined. The GUI and Lisp are constructed using this class system. It has function level dynamic binding and loading. Individual functions are loaded and bound on demand as tasks are created and distributed. Currently functions are loaded from the CPU file system on which the task finds itself, but these will eventually come from the server object that the task was created with and functions will be transported across the network as required. Functions are shared between all tasks that share the same server object, so only a single copy of a function is loaded regardless of how many tasks use that function. The interface to the system functions is provided as a set of static classes, easing use and removing the need to remember static function locations, plus decoupling the source from changes at the system level. Look in the sys/xxx.inc files to see the interface definitions. A command terminal with a familiar interface for pipe style command line applications is provided with args vector, stdin, stdout, stderr etc. Classes for easy construction of pipe masters and slaves, with arbitrary nesting of command line pipes. While this isn't the best way to create parallel applications it is very useful for the composition of tools and hides all the message passing behind a familiar streams based API. A Common Lisp like interpreter is provided. This is available from the command line, via the command lisp. To build the entire system type (make), calculates minimum compile workload, or (make-all) to do everything regardless, at the Lisp command prompt. This Lisp has a C-Script 'snippets' capability to allow mixing of C-Script compiled expressions within assignment and function calling code. An elementary optimise pass exists for these expressions. Both the virtual assembler and C-Script compiler are written in Lisp, look in the sys/code.inc, lib/asm/xxx.inc, sys/func.inc, lib/trans/x64.inc, lib/trans/arm64.inc and lib/asm/vp.inc for how this is done. Some of the Lisp primitives are constructed via a boot script that each instance of a Lisp class runs on construction, see class/lisp/ boot.inc for details. The compilation and make environment, along with all the compile and make commands are created via the Lisp command line tool in lib/asm/asm.inc, again this auto runs for each instance of the lisp command run from the terminal. You can extend this with any number of additional files, just place them after the lisp command and they will execute after the lib/asm/asm.inc file and before processing of stdin. Don't get the idea that due to being coded in interpreted Lisp the assembler and compiler will be slow. A fully cleaned system build from source, including creation of a full recursive pre-bound boot image file, takes on the order of 2 seconds on a 2014 MacBook Pro ! Dev cycle (make) and (remake) under 0.5 seconds. It ain't slow ! Network link routing tables are created on booting a link, and the process is distributed in nature, each link starts a flood fill that eventually reaches all the CPU's and along the way has marked all the routes from one CPU to another. All shortest routes are found, messages going off CPU are assigned to a link as the link becomes free and multiple links can and do route messages over parallel routes simultaneously. Large messages are broken into smaller fragments on sending and reconstructed at the destination to maximize use of available routes. The -run command line option launches tasks on booting that CPU, such as the experimental GUI (a work in progress, -run gui/gui/gui.lisp). You can change the network launch script to run more than one GUI session if you want, try launching the GUI on more than CPU 0, look in funcs.sh at the boot_cpu_gui function ! :) The -l command line option creates a link, currently up to 1000 CPU's are allowed but that's easy to adjust. The shared memory link files are created in the tmp folder /tmp, so for example /tmp/000-001 would be the link file for the link between CPU 000 and 001. An example network viewed with ps looks like this for a 4x4 mesh network: ./main_gui -l 011-015 -l 003-015 -l 014-015 -l 012-015 ./main_gui -l 010-014 -l 002-014 -l 013-014 -l 014-015 ./main_gui -l 009-013 -l 001-013 -l 012-013 -l 013-014 ./main_gui -l 008-012 -l 000-012 -l 012-015 -l 012-013 ./main_gui -l 007-011 -l 011-015 -l 010-011 -l 008-011 ./main_gui -l 006-010 -l 010-014 -l 009-010 -l 010-011 ./main_gui -l 005-009 -l 009-013 -l 008-009 -l 009-010 ./main_gui -l 004-008 -l 008-012 -l 008-011 -l 008-009 ./main_gui -l 003-007 -l 007-011 -l 006-007 -l 004-007 ./main_gui -l 002-006 -l 006-010 -l 005-006 -l 006-007 ./main_gui -l 001-005 -l 005-009 -l 004-005 -l 005-006 ./main_gui -l 000-004 -l 004-008 -l 004-007 -l 004-005 ./main_gui -l 003-015 -l 003-007 -l 002-003 -l 000-003 ./main_gui -l 002-014 -l 002-006 -l 001-002 -l 002-003 ./main_gui -l 001-013 -l 001-005 -l 000-001 -l 001-002 ./main_gui -l 000-012 -l 000-004 -l 000-003 -l 000-001 -run gui/gui Getting Started Take a look at the docs/INTRO.md for instructions to get started on all the supported platforms. The experimental GUI requires the SDL2 library to be installed. Download these from the SDL web site. * SDL Or get them via your package manager. sudo apt-get install libsdl2-dev Make/Run/Stop Take a look at the docs/INTRO.md for platform specific instructions. The following is for OSX and Linux systems. Windows has a pre-built main.exe provided, or you can configure Visual Studio to compile things yourself if you wish. Installing The first time you download ChrysaLisp you will only have the vp64 emulator boot image. You must create the native boot images the first time round. This is a little slower than subsequent boots and system compiles but allows us to keep the snapshot.zip file as small as possible. make install Or on Windows install.bat Make make Run ./run_tui.sh [-n num_cpus] [-e] [-b base_cpu] Text user interface based fully connected network. Each CPU has links to every other CPU. Careful with this as you can end up with a very large number of link files and shared memory regions. CPU 0 launches a terminal to the host system. ./run.sh [-n num_cpus] [-e] [-b base_cpu] Fully connected network. Each CPU has links to every other CPU. Careful with this as you can end up with a very large number of link files and shared memory regions. CPU 0 launches a GUI. ./run_star.sh [-n num_cpus] [-e] [-b base_cpu] Star connected network. Each CPU has a link to the first CPU. CPU 0 launches a GUI. ./run_ring.sh [-n num_cpus] [-e] [-b base_cpu] Ring connected network. Each CPU has links to the next and previous CPU's. CPU 0 launches a GUI. ./run_tree.sh [-n num_cpus] [-e] [-b base_cpu] Tree connected network. Each CPU has links to its parent CPU and up to two child CPU's. CPU 0 launches a GUI. ./run_mesh.sh [-n num_cpus on a side] [-e] [-b base_cpu] Mesh connected network. Each CPU has links to 4 adjacent CPU's. This is similar to Transputer meshes. CPU 0 launches a GUI. ./run_cube.sh [-n num_cpus on a side] [-e] [-b base_cpu] Cube connected network. Each CPU has links to 6 adjacent CPU's. This is similar to TMS320C40 meshes. CPU 0 launches a GUI. Stop Stop with: ./stop.sh Snapshot Snapshot with: make snapshot This will create a snapshot.zip file of the obj/ directory containing only the host directory structures, the pre-compiled Windows main_gui.exe and main_tui.exe plus the VP64 boot_image files ! Used to create the more compact snapshot.zip that goes up on Github. This must come after creation of (make-all-platforms) boot_image set ! obj/x86_64/AMD64/Darwin/ obj/x86_64/AMD64/Linux/ obj/aarch64/ARM64/Linux/ obj/aarch64/ARM64/Darwin/ obj/vp64/VP64/sys/boot_image obj/x86_64/WIN64/Windows/main_gui.exe obj/x86_64/WIN64/Windows/main_tui.exe Clean Clean with: make clean About Parallel OS, with GUI, Terminal, OO Assembler, Class libraries, C-Script compiler, Lisp interpreter and more... Topics linux gui vm lisp osx assembly x86-64 os aarch64 raspberry-pi-3 Resources Readme License GPL-2.0 license Stars 1.4k stars Watchers 65 watching Forks 85 forks Releases 43 New Year Cheer Latest Jan 12, 2023 + 42 releases Packages 0 No packages published Contributors 9 * @vygr * @FrankC01 * @nuclearfall * @baydrift * @neauoire * @metalbot * @no-identd * @traverseda * @locriacyber Languages * C++ 48.1% * Common Lisp 23.9% * SourcePawn 6.7% * Assembly 6.5% * HTML 3.7% * NASL 3.6% * Other 7.5% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.