Coder Social home page Coder Social logo

kanaka / minimal Goto Github PK

View Code? Open in Web Editor NEW
629.0 21.0 32.0 932 KB

A Delightfully Diminutive Lisp. Implemented in < 1 KB of JavaScript with JSON source, macros, tail-calls, JS interop, error-handling, and more.

Home Page: http://kanaka.github.io/miniMAL

License: Other

Makefile 11.73% HTML 15.11% JavaScript 26.84% Python 21.89% CSS 11.59% Shell 0.76% Clojure 12.09%
lisp javascript python mal tiny small code-golf macros lambda tail-calls

minimal's Issues

Feature request: Ability to control side effects

I would very much like to be able to control the environment that miniMAL instructions can execute in. The ability to set miniMAL({}) does not prevent access to the whole of JS, including the dangerous global function eval.

Being able to have control, or prevent any crazy stuff potentially executing from a miniMAL program, would enable this library to be used for user customizable dynamic rules, like access rules, event rules etc, that can be stored as JSON in a database.

I guess that some second argument to miniMAL() preventing just the "js" feature, would do most of the trick? (But there would probably be a more general way to do it)

Not able to run miniMAL as a library

I only get:

TypeError: Object prototype may only be an Object or null: undefined

when running node test.js.
Where test.js is:

const miniMAL = require('minimal-lisp');
const m = miniMAL();
m.eval(["+", 2, 3]);

Questions about license/copyright of miniMAL specifications

Hello.

I'm trying to develop another implementation for miniMAL language
adding some more features, not using your original source code except unit tests.

Questions:

  1. Is there any license or copyright as if miniMAL's langage SPECIFICATIONS?
    • Of course I know your miniMAL IMPLEMENTATION is distributed undef MPL 2.0.
  2. Is there any limitations to publish my miniMAL implementation to NPM
    under MIT license?
  3. Can I still call or name my implementation as `miniMAL' language?
    My implementation will not be small as your awesome code, but
    trying to pass most of unit tests (which are converted to Jest format).
  4. Can I refer your web pages from my documents?

Regards,

////
Note: I've also sent a e-mail to to your address written
on https://github.com/kanaka. You might get some more
detail about my plan if you have any chance to check the
mail.

`make clean` removes committed files

From a fresh clone:

miniMAL $ make clean && git status
----------------------------------------------
Running: make --no-print-directory -C js clean
rm -f *-uglify.js *-uglify-pretty.js *-regpack.js miniMAL-js1k.b64 miniMAL-node.js miniMAL-core.js web/miniMAL-js1k.js web/miniMAL-min.js web/miniMAL-core.js
----------------------------------------------
Running: make --no-print-directory -C python clean
rm -f *-minipy.py *.pyz miniMAL.py miniMAL.pyz
----------------------------------------------
Running: make --no-print-directory -C cljs clean
rm -f src-min/miniMAL/step0_repl.cljc src-min/miniMAL/step1_read_print.cljc src-min/miniMAL/step2_eval.cljc src-min/miniMAL/step3_env.cljc src-min/miniMAL/step4_if_fn_do.cljc src-min/miniMAL/step5_tco.cljc src-min/miniMAL/step6_file.cljc src-min/miniMAL/step7_interop.cljc src-min/miniMAL/step8_macros.cljc src-min/miniMAL/step9_try.cljc src-min/miniMAL/stepA_miniMAL.cljc miniMAL
rm -f build/step0_repl.js build/step1_read_print.js build/step2_eval.js build/step3_env.js build/step4_if_fn_do.js build/step5_tco.js build/step6_file.js build/step7_interop.js build/step8_macros.js build/step9_try.js build/stepA_miniMAL.js miniMAL.js
rm -fr build/cljs-runtime
rmdir -p build || true
rmdir: failed to remove 'build': No such file or directory
rmdir -p src-min/miniMAL || true
rmdir: failed to remove 'src-min/miniMAL': No such file or directory
On branch gh-pages
Your branch is up to date with 'origin/gh-pages'.

Changes not staged for commit:
	deleted:    js/miniMAL-core.js
	deleted:    js/miniMAL-node.js
	deleted:    js/web/miniMAL-core.js
	deleted:    js/web/miniMAL-js1k.js
	deleted:    js/web/miniMAL-min.js

no changes added to commit

Modulus?

Is there a good reason why modulus ("%") is not among the available operators?

Should it be, or is there an easy way around it?

Parser?

Seems like it would be (reasonably) trivial to write a parser for Lisp code (that was Lisp-0 compliant anyhow) by a simple regex.

Someone on Hacker News mentioned this for python:

`def parse(s): return json.loads('['+re.sub('([")])\s*(["(])','\g<1>,\g<2>',re.sub('[^()\s]+','"\g<0>"',s)).replace('(','[').replace(')',']')+']')``

Seems like most of that should go 1-to-1 into a JSON regex (as naive as it is).

Just a thought....

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.