Skip to content

Commit

Permalink
merge with devel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 23, 2023
2 parents cab80df + 0b0dae1 commit 058e71a
Show file tree
Hide file tree
Showing 59 changed files with 8,133 additions and 7,397 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
skip = ./node_modules*,./dist/*,./package-lock.json,./lib/srfi/*,./assets/UnicodeData.txt,./scripts/numerals.scm
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ assets/*.png binary
tests/snapshots/* binary
*.xcm binary
*.xcb binary
dist/** linguist-generated
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and test

on:
push:
branches:
- master
- devel
pull_request:
branches:
- master
- devel

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Update deps
run: sudo apt-get update
- name: Install ImageMagick
run: sudo apt-get -y install graphicsmagick
- name: checkout
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci
- run: make
- run: make lint
- run: make test
- run: make coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Codespell

on:
push:
branches:
- master
- devel
pull_request:
branches:
- master
- devel

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Main interpreter data flow.
Main public function is `exec` that accept string (code) and Environment instance. If environment is not specified it use main user environment (same as lips.env) which is child of global environment.

`exec` use internal `parse` function that is JavaScript generator that parse single S-Expression and `exec` use `evaluate` to evaluate the expression.
`evaluate` use multiple features like handling of Syntax, Macros and it auto resolve promises. `evaluate` may or may not return a promise. But `exec` always return a promise, so it's easier to use. You can never know which expression return a promise and which don't. `evaluate` also use `apply` function that was inspired by meta circual evaluator (but it was refactored into this state, it was not like this from beginning).
`evaluate` use multiple features like handling of Syntax, Macros and it auto resolve promises. `evaluate` may or may not return a promise. But `exec` always return a promise, so it's easier to use. You can never know which expression return a promise and which don't. `evaluate` also use `apply` function that was inspired by meta circular evaluator (but it was refactored into this state, it was not like this from beginning).

## UML Diagram of all classes

Expand All @@ -16,7 +16,7 @@ Main public function is `exec` that accept string (code) and Environment instanc
## Lexer

Lexer is created as simple state machine with `Lexer._rules` that specify
all the states. The sate change is simple it can change from null to given
all the states. The state change is simple it can change from null to given
state for a given token (e.g. symbol), remain in same state and move from
given state to null. The last change produce new token. Rules are dynamic
the parser can be update by syntax extensions so `Lexer.rules` is a getter
Expand Down
32 changes: 28 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## 1.0.0-beta.17
### Breaking
* chars are now not automatically unboxed to strings [#233](https://github.com/jcubic/lips/issues/233)
### Features
* make bookmark REPL dockable [#205](https://github.com/jcubic/lips/issues/205)
* make Strings iterators that return characters
* improve object literals [#237](https://github.com/jcubic/lips/issues/237)
* better error message with exception on invalid string literal
* add non-standard `with-input-from-string` function
### Bugfix
* fix using performance object for older version of Node
* fixing escaped symbols in CodeMirror
* fix parsing strings [#193](https://github.com/jcubic/lips/issues/193)
* add proper error message to `-->` macro [#200](https://github.com/jcubic/lips/issues/200)
* fix `performance.timeOrigin` on Node 12 [#207](https://github.com/jcubic/lips/issues/207)
* fix string->list to handle longer code points
* fix numerator and denominator [#213](https://github.com/jcubic/lips/issues/213)
* fix Map object repr
* fix parsing regular expressions [#238](https://github.com/jcubic/lips/issues/238)
* fix exception when syntax-rule macro contain undefined
* fix REPL clearing stdin when using read-line [#253](https://github.com/jcubic/lips/issues/253)
* add proper handling of [Paste Brackets mode in REPL for NodeJS](https://github.com/nodejs/node/pull/47150)

## 1.0.0-beta.16
### Breaking
* replace `get-script` with `get-resource` that work in Node and in browser and allows to load CSS
Expand All @@ -16,6 +39,7 @@
* fix bug in `quasiquote` and `unquote-splicing` [#194](https://github.com/jcubic/lips/issues/194)
* fix `inexact->exact` on integers [#199](https://github.com/jcubic/lips/issues/199)
* throw error on missing parentheses [#198](https://github.com/jcubic/lips/issues/198)
* fix empty syntax extensions as functions

## 1.0.0-beta.15
### Breaking
Expand All @@ -36,7 +60,7 @@
* property throw error when name is used without ellipsis
* fix using dot notation inside syntax-rules macros
* typecheck `string->symbol` and `symbol->string`
* fix `parent.frame` inside `Intepreter`
* fix `parent.frame` inside `Interpreter`
* fix `eval` without env
* fix quote as delimiter
* fix comma dot as two tokens
Expand Down Expand Up @@ -341,7 +365,7 @@
* `if` no longer require boolean as cond
* change how arrays are presented, they are look like scheme vector `#(...)`
* rename `string` to `repr`
* new API `lips.Intepreter` - for using interpreter that have different stdout/stdin
* new API `lips.Interpreter` - for using interpreter that have different stdout/stdin
* balanced_parenthesis now throw exception on broken code
* remove global env from public API (you can still access it using `env.parent`)
* remove `->` function (it will collide with SRFI 197 that may be implemented in the future)
Expand Down Expand Up @@ -374,7 +398,7 @@
* improve balancing parenthesis
* expose balanced method in public API (preferred name)
* optional brackets
* `interator?` function and detection if iterators from `repr` and `type` [#51](https://github.com/jcubic/lips/issues/51)
* `iterator?` function and detection if iterators from `repr` and `type` [#51](https://github.com/jcubic/lips/issues/51)
* `add-repr!` function to add string representations to objects
* new `string=?`, `sort`, `in`, `list-tail` and `bound?` functions
* add new `exit` function into executable interpreter
Expand Down Expand Up @@ -668,7 +692,7 @@
### Features
* new nth and reverse functions
* new type checking functions null? regex? pair? string? number? symbol? array? object? boolean?
* add lips source code that throwed exception in JavaScript error message
* add lips source code that threw exception in JavaScript error message
### Bug fixes
* fix lambda with rest parameter
### Breaking
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------

Part of the library (contentloaded function) licesed with
Part of the library (contentloaded function) licensed with

Copyright (c) 2005-2010 Diego Perini and NWBOX S.a.s.

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: publish test coveralls lint zero
.PHONY: publish test coveralls lint zero coverage

VERSION=1.0.0-beta.16
VERSION_DASH=`echo -n "1.0.0-beta.16" | sed "s/-/%E2%80%93/"`
Expand Down Expand Up @@ -65,10 +65,10 @@ assets/classDiagram.svg: assets/classDiagram

README.md: templates/README.md dist/lips.js .$(VERSION)
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e \
"s/{{VER_DASH}}/$(VERSION_DASH)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" \
"s/{{VER_DASH}}/$(VERSION_DASH)/g" -e "s#{{BRANCH}}#$(BRANCH)#g" -e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" \
-e "s/{{YEAR}}/${YEAR}/g" -e "s/{{DATE}}/${DATE_SHORT}/" -e "s/{{COMMIT}}/$(COMMIT)/g" \
< templates/README.md > README.md || \
$(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{YEAR}}/${YEAR}/g" \
$(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s#{{BRANCH}}#$(BRANCH)#g" -e "s/{{YEAR}}/${YEAR}/g" \
-e "s/{{CHECKSUM}}/$(TESTS_CHECKSUM)/g" -e "s/{{COMMIT}}/$(COMMIT)/g" -e "s/{{DATE}}/${DATE_SHORT}/" \
-e "s/{{VER_DASH}}/$(VERSION_DASH)/g" < templates/README.md > README.md

Expand Down Expand Up @@ -112,7 +112,7 @@ watch-lint:
watch-make:
@inotifywait -m -e close_write src/lips.js | while read even; do $(MAKE) --no-print-directory; done

coveralls:
coverage:
$(NPM) run coverage

lint:
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h1 align="center">
<img src="https://github.com/jcubic/lips/blob/master/assets/lips.svg?raw=true"
<img src="https://github.com/jcubic/lips/blob/devel/assets/lips.svg?raw=true"
alt="LIPS - Scheme Based Powerful Lisp Language" />
</h1>

[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.16-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
![1.0.0 Complete](https://img.shields.io/github/milestones/progress-percent/jcubic/lips/1?label=1.0.0%20Complete)
[![travis](https://travis-ci.com/jcubic/lips.svg?branch=master&aba7442b3be9483ca14039700e619680b8a73c37)](https://travis-ci.com/github/jcubic/lips)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=master&1abe29427d5cfaa14ca0afda5bb5d3b4)](https://coveralls.io/github/jcubic/lips?branch=master)
[![Build and test](https://github.com/jcubic/lips/actions/workflows/build.yaml/badge.svg?branch=devel&event=push)](https://github.com/jcubic/lips/actions/workflows/build.yaml)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&1eb2cfbcb9a646f24938a31ec46bbc33)](https://coveralls.io/github/jcubic/lips?branch=devel)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
![NPM Download Count](https://img.shields.io/npm/dm/@jcubic/lips)
![JSDelivr Download count](https://img.shields.io/jsdelivr/npm/hm/@jcubic/lips)
Expand Down Expand Up @@ -79,7 +79,7 @@ https://github.com/jcubic/lips/blob/master/lib/js/bookmark.js
```

Create any link in your bookmarks, edit it and copy paste the content of that file.
Affter you click on the link it will create the REPL at the bottom of the page.
After you click on the link it will create the REPL at the bottom of the page.
(NOTE: It may not work on every page because of content security policy;
e.g. google.com or gihub.com)

Expand Down Expand Up @@ -160,7 +160,7 @@ npm install -g @jcubic/lips@beta

you can run the interpreter from the terminal:

![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/master/assets/screencast.gif?raw=true)
![LIPS: Scheme interactive terminal](https://github.com/jcubic/lips/blob/devel/assets/screencast.gif?raw=true)


You can also run code in a string with:
Expand Down Expand Up @@ -199,14 +199,14 @@ Executables also return a S-Expression according to SRFI-176 use `lips --version

## FOSDEM'23 Presentation [Video]

[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/master/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)
[![FOSDEM 2023 - LIPS Scheme: Powerful introspection and extensibility](https://github.com/jcubic/lips/blob/devel/assets/fosdem-intro.png?raw=true)](https://fosdem.org/2023/schedule/event/lipsscheme/)

## Limitations
Because LIPS is tree walking interpreter sometimes it may be slow. Especially if you want to
process long arrays and use callback function. If the array is quite large each pice of code
process long arrays and use callback function. If the array is quite large each piece of code
inside the callback may slow down the processing. For example see:

script [reference.scm](https://github.com/jcubic/lips/blob/master/scripts/reference.scm)
script [reference.scm](https://github.com/jcubic/lips/blob/devel/scripts/reference.scm)

That generates reference documentation for all builtin functions and macros.
The slow part is `(names.sort name-compare)` (`Array::sort`) that take quite time to calculate,
Expand All @@ -222,12 +222,12 @@ something like this:
(arr.sort fn))
```

Another example of slow performace is using LIPS with React, the more code you put into components
Another example of slow performance is using LIPS with React, the more code you put into components
the slower the app will become.

Examples:
* [Preact app that update SVG](https://codepen.io/jcubic/pen/PojYxBP) - it requires to use debounce.
* [React with Hooks](https://codepen.io/jcubic/pen/PoKQmpq?editors=1000) - on click the UI freezes for ~300ms, you can see warnigs in dev tools.
* [React with Hooks](https://codepen.io/jcubic/pen/PoKQmpq?editors=1000) - on click the UI freezes for ~300ms, you can see warnings in dev tools.

The issue with performance is tracked in [#197](https://github.com/jcubic/lips/issues/197).

Expand Down
Loading

0 comments on commit 058e71a

Please sign in to comment.