naver / lispe Goto Github PK
View Code? Open in Web Editor NEWAn implementation of a full fledged Lisp interpreter with Data Structure, Pattern Programming and High level Functions with Lazy Evaluation à la Haskell.
License: Other
An implementation of a full fledged Lisp interpreter with Data Structure, Pattern Programming and High level Functions with Lazy Evaluation à la Haskell.
License: Other
Hi,
Thanks for Lispe
though it doesn't build on linux :
make all libs
mkdir -p bin mkdir -p objs mkdir -p objs/jag mkdir -p objs/testemojis fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/lispe.cxx -o objs/lispe.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/lispe.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/jagget.cxx -o objs/jagget.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/jagget.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/eval.cxx -o objs/eval.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/eval.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/elements.cxx -o objs/elements.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/elements.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/tools.cxx -o objs/tools.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/tools.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/systems.cxx -o objs/systems.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/systems.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/maths.cxx -o objs/maths.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/maths.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/strings.cxx -o objs/strings.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/strings.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/randoms.cxx -o objs/randoms.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/randoms.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/rgx.cxx -o objs/rgx.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/rgx.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/sockets.cxx -o objs/sockets.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/sockets.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/composing.cxx -o objs/composing.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/composing.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/ontology.cxx -o objs/ontology.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/ontology.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/sets.cxx -o objs/sets.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/sets.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/lists.cxx -o objs/lists.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/lists.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/dictionaries.cxx -o objs/dictionaries.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/dictionaries.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/straight_eval.cxx -o objs/straight_eval.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/straight_eval.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/tensors.cxx -o objs/tensors.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/tensors.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/jag.cxx -o objs/jag.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/jag.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/main.cxx -o objs/main.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/main.o] Error 127 (ignorée) fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -I/usr/include/ -DUNIX -Iinclude src/lispeditor.cxx -o objs/lispeditor.o make: fPIC: N'est pas un dossier make: [Makefile:22: objs/lispeditor.o] Error 127 (ignorée) o bin/lispe objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o objs/ontology.o objs/sets.o objs/lists.o objs/dictionaries.o objs/straight_eval.o objs/tensors.o objs/jag.o objs/main.o objs/lispeditor.o -ldl -lpthread -L/usr/lib64/ make: o: N'est pas un dossier make: [Makefile:34: lispe] Error 127 (ignorée) ar rcs bin/liblispe.a objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o objs/ontology.o objs/sets.o objs/lists.o objs/dictionaries.o objs/straight_eval.o objs/tensors.o ar: objs/lispe.o: Aucun fichier ou dossier de ce type make: *** [Makefile:50: liblispe] Error 1
This is not really an issue, but a heads-up - I wasn't able to compile this with the default config.
I had to install [email protected] and change my Makefile.in
to have these:
INCLUDEPYTHON = -I/usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Headers
PYTHONLIB = /usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Python
OS: macOS 10.14.6 (18G7016) Mojave
Built-in python: 2.7.16
~/repos/lispe ▶ python configure.py
This is a Mac OS platform
~/repos/lispe ▶ make all libs
mkdir -p bin
mkdir -p objs
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/lispe.cxx -o objs/lispe.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/jagget.cxx -o objs/jagget.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/eval.cxx -o objs/eval.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/elements.cxx -o objs/elements.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/tools.cxx -o objs/tools.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/systems.cxx -o objs/systems.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/maths.cxx -o objs/maths.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/strings.cxx -o objs/strings.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/randoms.cxx -o objs/randoms.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/rgx.cxx -o objs/rgx.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/sockets.cxx -o objs/sockets.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/composing.cxx -o objs/composing.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/jag.cxx -o objs/jag.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/main.cxx -o objs/main.o
g++ -fPIC -std=c++11 -w -c -O3 -DPOSIXREGEX -DUNIX -Iinclude src/lispeditor.cxx -o objs/lispeditor.o
g++ -o bin/lispe objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o objs/jag.o objs/main.o objs/lispeditor.o -ldl -lpthread -L/usr/lib/
ar rcs bin/liblispe.a objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o
ranlib bin/liblispe.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C curl clean all
rm -f ../objs/curl/*.o
mkdir -p ../objs/curl
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude -Iinclude/linux src/lispe_curl.cxx -o ../objs/curl/lispe_curl.o
g++ -shared -o ../bin/liblispe_curl.so ../objs/curl/lispe_curl.o -L../bin -llispe -ldl -L/usr/lib/ -lcurl -lpthread
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C xml clean all
rm -f ../objs/xml/*.o
mkdir -p ../objs/xml
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude src/lispe_xml.cxx -o ../objs/xml/lispe_xml.o
g++ -shared -o ../bin/liblispe_xml.so ../objs/xml/lispe_xml.o -L../bin -lxml2 -llispe -ldl -pthread -L/usr/lib/
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C sqlite clean all
rm -f ../objs/sqlite/*.o
mkdir -p ../objs/sqlite
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_THREADSAFE -I../include -Iinclude src/lispe_sqlite.cxx -o ../objs/sqlite/lispe_sqlite.o
g++ -shared -o ../bin/liblispe_sqlite.so ../objs/sqlite/lispe_sqlite.o -L../bin -L/usr/lib/ -lsqlite3 -llispe -ldl -lpthread
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C pythonlispe clean all
rm -f ../objs/python/*.o
mkdir -p ../objs/python
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I/Library/Frameworks/Python.framework/Versions/3.8/Headers -I../include -Iinclude src/lispe_python.cxx -o ../objs/python/lispe_python.o
src/lispe_python.cxx:24:10: fatal error: 'Python.h' file not found
#include <Python.h>
^~~~~~~~~~
1 error generated.
make[1]: *** [../objs/python/lispe_python.o] Error 1
make: *** [libs] Error 2
Both /Library/Frameworks/Python.framework/Versions/3.8/Headers
and /Library/Frameworks/Python.framework/Versions/3.8/Python
do not exist.
So I assumed I have to install Python 3.8 - since I'm on macOS and have Homebrew installed I ran brew install [email protected]
, then edited my Makefile.in
to replace these lines:
- INCLUDEPYTHON = -I/Library/Frameworks/Python.framework/Versions/3.8/Headers
- PYTHONLIB = /Library/Frameworks/Python.framework/Versions/3.8/Python
+ INCLUDEPYTHON = -I/usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Headers
+ PYTHONLIB = /usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Python
then re-ran make
:
~/repos/lispe ▶ make all libs
mkdir -p bin
mkdir -p objs
g++ -o bin/lispe objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o objs/jag.o objs/main.o objs/lispeditor.o -ldl -lpthread -L/usr/lib/
ar rcs bin/liblispe.a objs/lispe.o objs/jagget.o objs/eval.o objs/elements.o objs/tools.o objs/systems.o objs/maths.o objs/strings.o objs/randoms.o objs/rgx.o objs/sockets.o objs/composing.o
ranlib bin/liblispe.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C curl clean all
rm -f ../objs/curl/*.o
mkdir -p ../objs/curl
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude -Iinclude/linux src/lispe_curl.cxx -o ../objs/curl/lispe_curl.o
g++ -shared -o ../bin/liblispe_curl.so ../objs/curl/lispe_curl.o -L../bin -llispe -ldl -L/usr/lib/ -lcurl -lpthread
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C xml clean all
rm -f ../objs/xml/*.o
mkdir -p ../objs/xml
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude src/lispe_xml.cxx -o ../objs/xml/lispe_xml.o
g++ -shared -o ../bin/liblispe_xml.so ../objs/xml/lispe_xml.o -L../bin -lxml2 -llispe -ldl -pthread -L/usr/lib/
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C sqlite clean all
rm -f ../objs/sqlite/*.o
mkdir -p ../objs/sqlite
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_THREADSAFE -I../include -Iinclude src/lispe_sqlite.cxx -o ../objs/sqlite/lispe_sqlite.o
g++ -shared -o ../bin/liblispe_sqlite.so ../objs/sqlite/lispe_sqlite.o -L../bin -L/usr/lib/ -lsqlite3 -llispe -ldl -lpthread
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C pythonlispe clean all
rm -f ../objs/python/*.o
mkdir -p ../objs/python
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I/usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Headers -I../include -Iinclude src/lispe_python.cxx -o ../objs/python/lispe_python.o
g++ -shared -o ../bin/pylispe.so ../objs/python/lispe_python.o /usr/local/Cellar/[email protected]/3.8.7/Frameworks/Python.framework/Python -L../bin -llispe -ldl -lpthread -L/usr/lib/
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C transducer clean all
rm -f ../objs/transducer/*.o
mkdir -p ../objs/transducer
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude src/lispe_transducer.cxx -o ../objs/transducer/lispe_transducer.o
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude src/automaton.cxx -o ../objs/transducer/automaton.o
g++ -std=c++11 -fPIC -w -c -O3 -DUNIX -I../include -Iinclude src/conversion.cxx -o ../objs/transducer/conversion.o
g++ -shared -o ../bin/liblispe_transducer.so ../objs/transducer/lispe_transducer.o ../objs/transducer/automaton.o ../objs/transducer/conversion.o -L../bin -llispe -ldl -lpthread -L/usr/lib/
And now I have ./bin/lispe
to run:
Lisp Elémentaire (1.2021.1.27.14.31/40201)
help: display available commands
<> 1>
On the page 8. Mini Zork: A functional adventure, should it be Scott Adam's Adventureland? If so, it needs an update.
There's a bug in https://github.com/naver/lispe/wiki/6.16-Why-Lisp but I don't see a way to submit a PR for wiki pages.
Just after where it says "We will now perform a prefixed walk", the list of tokens should contain a
in place of to
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.