texodus / forml Goto Github PK
View Code? Open in Web Editor NEWA programming language
License: BSD 3-Clause "New" or "Revised" License
A programming language
License: BSD 3-Clause "New" or "Revised" License
$ cd src/forml
$ forml -o app readme.forml
forml: -o: openFile: does not exist (No such file or directory)
Currently Closure integration is leveraged primarily for function inlining. It would be nice if Closure would also prune dead definitions from a module.
This won't work -> module "this won't work"
module test
fun x = "I am a `x`"
module other
exec x = x.fun "correctly implemented example"
exec test == "I am a correctly implemented example"
ModuleExpression
This is clever, easily googl-able and would fit well on a sticker or t-shirt. For people who typically wear ML-branded clothing, that is.
Note that Forml also requires Closure for optimizations and either Phantom.js or Node.js
Install the Haskell Platform, then...
Please write Forml in ONE language, either ANSI C.
test case :
189 module "Test that nested modules alias correctly"
190
191 open prelude
192
193 module welcome
194 module to
195 module costco
196 greeting = "I love you"
197
198 open welcome.to.costco as idiocracy
199
200 idiocracy.greeting is "I love you"
result :
Test failed at line null
undefined
Expected undefined
Actual undefined
[X] Testing tests.js [Phantom.js]
with_page does not work correctly and would be quite handy for testing a real site.
$ cd src/forml
$ forml tetris.forml
[*] Loading prelude.forml
[X] Loading tetris.forml
Types do not unify: found Array Array Num, expecting Piece
Types do not unify: found Array Array Num, expecting Piece
at line 211, column 21
Types do not unify: found Array Array Num, expecting Piece
at line 249, column 19
Types do not unify: found Array Array Num, expecting Piece
at line 287, column 21
Types do not unify: found Array Array Num, expecting Piece
at line 348, column 25
11 additional errors
The existing 0.2 on hackage doesn't build for me, but the latest from github does. Might be nice to do a new hackage release.
test case
module whatever
open prelude
asdf n = n + 1
will parse df as the binding for prelude and complain that the rest of the statement is invalid
~ $ cabal install forml
Resolving dependencies...
Configuring forml-0.1.1...
Building forml-0.1.1...
Preprocessing executable 'forml' for forml-0.1.1...
[ 1 of 24] Compiling Forml.Parser.Utils ( src/hs/Forml/Parser/Utils.hs, dist/build/forml/forml-tmp/Forml/Parser/Utils.o )
src/hs/Forml/Parser/Utils.hs:31:1:
Warning: The import of `Text.Parsec.Prim' is redundant
except perhaps to import instances from `Text.Parsec.Prim'
To import instances alone, use: import Text.Parsec.Prim()
src/hs/Forml/Parser/Utils.hs:196:1:
Warning: Top-level binding with no type signature:
optional_sep :: ParsecT T.Text () (StateT SourcePos Identity) ()
src/hs/Forml/Parser/Utils.hs:203:1:
Warning: Top-level binding with no type signature:
withPosTemp :: forall b s u (m :: * -> *) a.
(Show a, MonadState a m) =>
ParsecT s u m b -> ParsecT s u m b
[ 2 of 24] Compiling Forml.Types.TypeDefinition ( src/hs/Forml/Types/TypeDefinition.hs, dist/build/forml/forml-tmp/Forml/Types/TypeDefinition.o )
[ 3 of 24] Compiling Forml.Types.Symbol ( src/hs/Forml/Types/Symbol.hs, dist/build/forml/forml-tmp/Forml/Types/Symbol.o )
[ 4 of 24] Compiling Forml.Types.Type ( src/hs/Forml/Types/Type.hs, dist/build/forml/forml-tmp/Forml/Types/Type.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
... lots more packages loaded, then:
[ 5 of 24] Compiling Forml.Static ( src/hs/Forml/Static.hs, dist/build/forml/forml-tmp/Forml/Static.o )
src/hs/Forml/Static.hs:53:39:
Exception when trying to run compile-time code:
src/html/styles.css: openBinaryFile: does not exist (No such file or directory)
Code: embedFile "src/html/styles.css"
In the first argument of `B.toString', namely
`$(embedFile "src/html/styles.css")'
In the second argument of `mappend', namely
`B.toString ($(embedFile "src/html/styles.css"))'
In the first argument of `mappend', namely
`B.toString ($(embedFile "lib/js/jasmine-1.0.1/jasmine.css"))
`mappend` B.toString ($(embedFile "src/html/styles.css"))'
cabal: Error: some packages failed to install:
forml-0.1.1 failed during the building phase. The exception was:
ExitFailure 1
By contrast, the following works fine:
$ git checkout -q 37bce8c
$ cabal configure; cabal install
As a developer
When I type forml -h or -help
I expect a list of flags with descriptions
So, I don't have to look at the CLI.hs file to see what flags are available
And other practical reasons...
$ cd src/forml
$ forml -node-test readme.forml
[*] Loading prelude.forml
[*] Loading readme.forml
[*] Closure readme.js remote][remote]
[-] Closure [tests]
[*] Docs
ode.js]
Test failed at line 372
undefined
Expected true
Actual {"error":{}}
Test failed at line 577
undefined
Expected undefined
Actual undefined
[stdin]:98
})}}};this.split=b;var u=0,h={reportRunnerResults:function(){return phantom.ex
^
ReferenceError: phantom is not defined
at Object.reportRunnerResults ([stdin]:98:321)
at [object Object].reportRunnerResults ([stdin]:41:317)
at [object Object].finishCallback ([stdin]:52:267)
at [object Object].onComplete ([stdin]:51:492)
at [object Object].next_ ([stdin]:51:19)
at [stdin]:50:439
at [object Object].finish ([stdin]:64:269)
at [object Object].onComplete ([stdin]:65:466)
at [object Object].next_ ([stdin]:51:19)
at [stdin]:50:439
[X] Testing readme.js [Node.js]
Defining a new module should implicitly import the symbols defined in prelude, as the language is effectively useless without it.
This should be blocked on #10 to prevent inflating the target. Once this is done though, we can also integrate the individual closure calls, which will speed up multi-file compiles a good deal
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.