gbluma / concatenative-php Goto Github PK
View Code? Open in Web Editor NEWConcatenative-PHP, a lightweight functional language built on PHP.
License: Other
Concatenative-PHP, a lightweight functional language built on PHP.
License: Other
It should not be necessary to call function
or lambda
to build a quotation; that is unwanted line noise. The following should work.
{ 1 2 3 } [ echo ] map
it should be easy to fire off a simple REPL
php language.php
>>> "hello world\n" echo .
hello world
>>>
The reader is currently kind of dumb about how it parses control characters like ;
and :
. If they exist inside of a string or a quotation it bombs out early.
The interpreter already has a variable called defer
which is used to count the nesting of things like quotations. If defer
is less than or equal to 0 then it can be used as a control word, otherwise it is just a meaningless word.
( drops the space after "Hello" )
>>> : say-hello ( name -- saying ) "Hello " swap ++ ;
>>> "Garrett" say-hello .
"HelloGarrett"
>>> : say-hello ( name -- saying ) "Hello: " swap ++ ;
>>> "Garrett" say-hello .
( returns nothing )
Implement the following, dip
, dup
, bi
, swap
, drop
, and the variants of them.
Also, it would be useful to implement the period (.
) operator as well.
There should be an option to simply export the code without running it.
php language.php --export test.php test.cphp
Traditional Forth makes definition easy using the colon (:
) operator.
: square ( x -- x' ) dup * ;
Should include a lens system for accessing and updating the prototypes and arrays.
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.