GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rootmos/silly-joy: An interpreter for the concatenative language Joy, written in Haskell using extensible-effects

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
app
app
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
Setup.hs
Setup.hs
 
 
demo.gif
demo.gif
 
 
repl.expect
repl.expect
 
 
silly-joy.cabal
silly-joy.cabal
 
 
stack.yaml
stack.yaml
 
 

Repository files navigation

silly-joy

Build, test and push image

silly-joy is an interpreter for the concatenative programming language Joy, implemented in Haskell using extensible-effects.

What's Joy?

Here are some resources:

  • Mathematical foundations of Joy by Manfred von Thun (archived here, the paper that sparked this project)
  • On Wikipedia
  • Official page
  • Over at http://www.concatenative.org

Try it out!

Simplest way to try it out is by using Docker:

docker run -it rootmos/silly-joy --tui

You'll be greeted by a terminal UI with the REPL as well as a window showing the current stack. Very convenient when learning stack-based languages!

demo

Example session

> 1 2 +
> :stack
3
> 12 *
> print
36
> fact := [[pop 0 =] [pop pop 1] [ [dup 1 -] dip dup i *] ifte] dup i
> 10 fact
> :st
3628800
> ["foo" "bar" strcat] [strlen] b
> dup print
6
> 1 swap - print
-5
> even := 2 % 0 =
> odd := even not
> 3 odd 2 even and print
true
> prime := [dup even [3 <] dip or] [2 =] [prime_trial_division] ifte
> prime_trial_division := 3 [[pop % null] [pop =] [[2 +] dip x] ifte] x
> [2 3 4 5 6 7 8 9 10 11 12 13] [prime] map print
[true true false true false true false false false true false true]
> sum := 0 [+] fold
> div-3-5 := [dup [3 % null] dip 5 % null or] filter
> up-to := pred [[]] [cons] primrec
> 10 up-to div-3-5 sum print
23
> next-fib := dup [+] dip swap
> add-if-even := [even] [dup [rotate] dip + rotate] [] ifte
> 0 1 1 [100 >] [pop pop] [next-fib add-if-even] [i] genrec print
188

About

An interpreter for the concatenative language Joy, written in Haskell using extensible-effects

Topics

concatenativeconcatenative-languageextensible-effectshaskelljoy

Resources

Readme
BSD-3-Clause license
Activity

Stars

39 stars

Watchers

1 watching

Forks

4 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.