Skip to content
المشاريع

حول

لغة Lisp صغيرة تُستخدم أساسًا للتفاعل مع البرامج الإبداعية: يُحرر البرنامج نفسه على هيئة شيفرة أو كتل، أو يدويًا على لوحة رسم. وGlisp Canvas تطبيق للرسم المتجهي مبني عليها.

التصميم والوسائط

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
٠
خلال شهر
+٧

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Glisp

A small functional language for embedding in creative software, and a vector drawing app built on it. A program can be edited as text, as blocks, or by dragging what it draws on a canvas.

This is a work in progress, and the language may still change.

Glisp Canvas, with a program in the code panel, the shapes it draws with one selected, and the parameters of that shape in the inspector

Example

turn = (/ tau 96)
ring = (map (range 0 96) (=> [i: number]: _
  [(+ 400 (* 290 (cos (* i turn))))
   (+ 400 (* 290 (sin (* i turn))))]))
[
  dots = (spray ring 7 3 26 44 "#ff4d2e" "#ffd23f")
  rays = (map (range 0 24) (=> [i: number]: _
    (style
      (path.line
        [(+ 400 (* 70 (cos (* i 4 turn)))) (+ 400 (* 70 (sin (* i 4 turn))))]
        [(+ 400 (* 215 (cos (* i 4 turn)))) (+ 400 (* 215 (sin (* i 4 turn))))])
      stroke: "#ffffff" width: 3)))
  bg = (solid "#1473e6")
]

A ring of orange dots around white lines on blue, as the program above draws it

About

Glisp stands for Graphical LISP. A project in the drawing app is a Glisp program: dragging a handle on the canvas rewrites a value in the program, and the program can be edited as code at any time. The app is not aimed at one kind of graphics.

In the language:

  • Evaluation does not change the AST or any environment. An effect is an IO value that the host runs.
  • There is no clock or built-in source of entropy. random makes a sequence from a seed, which is part of the program.
  • An error in a program gives () and a diagnostic, rather than throwing. A typed slot turns () into its type's default.
  • Types are sets of values, with structural subtyping.
  • Results are cached on what a node refers to, so a value that an edit did not affect stays ===.
  • solve works out what to write in the program for a value to come out as wanted, which is how dragging works.
  • @glisp/lang has no dependencies.

See the guide and the specification.

Development

git clone --recurse-submodules https://github.com/baku89/glisp
cd glisp
npm install

npm run dev:canvas   # the drawing app
npm run dev          # the website, with the guide and the playground
npm run repl         # a REPL in the terminal
npm test
npm run typecheck
Directory
packages/lang The language, @glisp/lang
packages/repl The terminal REPL
packages/tweeq Editing an AST through Tweeq widgets
site/canvas The drawing app
site/lang The website
spec The specification, whose marked examples run as tests

The drawing app uses pave for paths, geome for geometry, and linearly for vectors.

Not done yet

  • Tools that can be written by the user
  • A timeline, and video export
  • Raster images and GLSL filters
  • Binding controllers over OSC or MIDI

Earlier version

The first version, from 2020, was a design tool with an interpreter based on Make a Lisp. It is still online. This repository has since been rewritten.

Related projects

Credits

By Baku Hashimoto. Thanks to Naoto Hieda for examples, suggestions and translation, and to the sponsors.

MIT License. See LICENSE.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…