PureScript compiler written in PureScript
purescript / purescript-in-purescript Goto Github PK
View Code? Open in Web Editor NEWPureScript compiler written in PureScript (On hold / inactive)
License: MIT License
PureScript compiler written in PureScript (On hold / inactive)
License: MIT License
I started work on this, but it means updating Compiler
, Interpreter
, etc. as well due to the introduction of Eff
.
module Language.PureScript.Prelude where
import Control.Monad.Eff
import Data.Array (map)
import Node.Args (EArgs(), argv)
import Node.Path
import Prelude.Unsafe
preludeFiles :: forall eff. Eff (args :: EArgs | eff) [String]
preludeFiles = do
args <- argv
let preludeBaseDir = join (dirname $ args `unsafeIndex` 1) "../prelude/"
return $ map (\x -> preludeBaseDir ++ x)
[ "Prelude.purs"
, "Prelude/Unsafe.purs"
, "Control/Monad/Eff.purs"
, "Control/Monad/Eff/Unsafe.purs"
, "Control/Monad/ST.purs"
, "Data/Eq.purs"
, "Data/Function.purs"
, "Debug/Trace.purs"
]
I want to use purescript-in-purescript, but it cannot make.
here is error log.
$ psc --version
0.5.1
$ grunt
Running "pscMake:0" (pscMake) task
>> Make failed:
>> "src/Language/PureScript/Parser/Lexer.purs" (line 5, column 20):
>> unexpected 'h'
>> expecting no indentation or end of input
Warning: Use --force to continue.
Aborted due to warnings.
What can I do?
This will be fixed when capture-avoiding substitution and proper TCO are implemented in purescript
.
Try
loop _ = loop {}
Let's check these off as we finish them.
We can use the comments to assign these to ourselves so we don't duplicate work.
The parser is slow on anything but the smallest of inputs. It is probably related to the way purescript-parsing
works.
Only the lexer shows position info on failure.
Any single line comment beginning with more than two dashes gets lexed as a symbol, and not as a comment.
Exceptions thrown by theImpossibleHappened
, pattern match failure etc. get caught by catchException
in main
. This is a bigger issue with purescript-exceptions
. The Exception
effect should not contain an exception type, since we can't tell in general what type was thrown.
We should also try to profile the running Javascript to see where the bottleneck is.
Either by compiling this with the haskell version, or ideally compiling this with a version of ps-in-ps
from npm I guess. Probably need to do #17 first for this to be worthwhile.
Values and Kinds seem to work, but Types generates a stack overflow in node.
Also, we might want to consider using fix
to implement the pretty printers so that we don't have to explicitly thunk everything.
Try the Auto.purs or Church.purs test cases.
...as far as I can tell anyway, pretty weird.
โ purescript-arrays git:(master) psc2 src/**/*.purs bower_components/purescript-*/src/**/*.purs
Expected RBrace, found LName ("in") at line 209, column 46
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.