Giter Site home page Giter Site logo

denkspuren / consize Goto Github PK

View Code? Open in Web Editor NEW
33.0 6.0 7.0 5.92 MB

Consize is a concatenative programming language

License: Other

Clojure 98.24% Dockerfile 1.76%
concatenative-programming-language concatenative-programs interpreter clojure concatenative concatenative-language concatenative-interpreting-language programming

consize's People

Contributors

d00mch avatar denkspuren avatar keddelzz avatar snicki13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

consize's Issues

Distill minimal dynamic language VM from consize, Factor, Forth,...

Is it possible to distill minimal dynamic language VM to make it separate ultra portable project to write pure dynamic object languages like Factor, consize, SmallTalk,... ?

It would be great to have a lot of VM ports to widely used platforms (Android in the first place for me), and some system independent image format (or it can be recompiled for the concrete platform if required).

I've done some experiments with Python here: https://ponyatov.github.io/DLR/
and extra compact fork there (in progress): https://github.com/ponyatov/o
but maybe it will be more progressive to share efforts on porting.

Revise LaTeX resources in /doc

  • decide what to keep in the doc and what not
  • generate the pdf and upload pdf in git
  • extract prelude-plain.txt from the documentation
  • run tests
  • generate a dump prelude.txt

Unexpected behavior of word 'undocument'

On my machine the word 'undocument' doesn't work as expected.

Steps to reproduce

  1. Create a file 'Test.txt' with the following content:
This is literate documentation.

>> Definition of a word.
>> Definition of another word.

This is more documentation.
  1. Start the consize repl as described in Run consize and type in
> \ Test.txt slurp undocument

Expected behavior

The top of the stack should be a word, with the content

Definition of a word.
Definition of another word.

Actual behavior

On tos is a word, with the content

Definition of a word.

Probable fix

Change the relevant regex in the vm implementation to #"%?>> (.*)[(\r\n)\r\n]".

Potentially relevant details of my machine

  • OS: Linux Mint 18.3 Sylvia
  • Clojure Version: 1.9.0, I'm using the installed instead of the slim version.

Clojure 1.11.2 erzeugt Problem mit Backslash in Consize

Clojure 1.11.2 erzeugt Problem mit Backslash in Consize

Problem

Mit Clojure 1.11.2 hat sich das Verhalten des Backslash-Zeichens "\" verändert. Auf das Problem ist Justin Sauer (@Al4han) gestoßen.

Die Eingabe \ rot \ dup sollte auf dem Datastack die Wörter rot dup hinterlassen, stattdessen ergibt sich ein rot rot. Das rot wird wie erwartet als Wort auf dem Datastack abgelegt, der zweite Backslash hingegen führt unerwartet zu einem Zeilenumbruch für die nächste Eingabe. Das ist daran zu erkennen, dass die Eingabe über die Consize-REPL überraschenderweise zerlegt wird. Die Eingabe

This is Consize -- A Concatenative Programming Language
> \ rot \dup

wird nach der ENTER-Taste wie folgt dargestellt

> \ rot
rot
> dup
rot rot
>

Eingrenzung des Fehlers

Der Fehler taucht in Clojure 1.11.2 auf, nicht jedoch in der Vorgängerversion 1.10.3 oder in einer Version davor. (Mit Dank an @Al4han für die Hilfe bei der Eingrenzung des Fehlers.) Das Problem lässt sich eingrenzen auf die read-line-Funktion von Clojure, die von der Consize-Implementierung verwendet wird. Mit Clojure 1.11.2 ergibt sich bei der Eingabe von \ rot \ dup nach (read-line):

Clojure 1.11.2
user=> (read-line)
\ rot
"\\ rot"
user=> dup
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: dup in this context

Die Funktion sollte sich tatsächlich wie folgt verhalten:

Clojure 1.8.0
user=> (read-line)
\ rot \ dup
"\\ rot \\ dup"
user=>

Workaround als Lösung

Es gibt derzeit zwei Lösungen:

  • Verwendung der Clojure-Version 1.10.3 (so wie im README.md beschrieben). Start mit
% clj -M consize.clj "\ Prelude-plain.txt run say-hi"
This is Consize -- A Concatenative Programming Language
> 

(Wie man eine ältere Clojure-Version mit brew installiert, ist bei Stackoverflow nachzulesen.)

  • Verwendung der alten im /src-Verzeichnis hinterlegten clojure-1.5.1.jar, deren Verwendung in der Dokumentation Consize.pdf beschrieben ist. Start mit
% java -cp clojure-1.5.1.jar clojure.main consize.clj "\ Prelude-plain.txt run say-hi"
This is Consize -- A Concatenative Programming Language
>

Beachten Sie, dass bei der Verwendung der beigefügten Docker-Konfiguration stets die aktuellste Clojure-Version verwendet wird, das Problem also auch in einer Docker-Umgebung existiert. Hier hilft z.B. ein älteres, aber sicherheitskritisches Image.

Possible typo in documentation: `%>` should be `%>>`

The documentation for the undocument-word mentions two possible prefixes for initiating a source code line:
>> and %>. Source

A few lines further in the document, a new prefix is mentioned: %>>. Source

Since %> was mentioned first, I would expect %>> to be an invalid prefix, but the implementation of undocument seems to only treat >> and %>> as valid prefixes. So I suspect that the first occurrence of %> is a type and just missing another >.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.