GithubHelp home page GithubHelp logo

purescript / purescript-in-purescript Goto Github PK

View Code? Open in Web Editor NEW
60.0 19.0 7.0 1.47 MB

PureScript compiler written in PureScript (On hold / inactive)

License: MIT License

JavaScript 0.29% PureScript 99.71%

purescript-in-purescript's Introduction

purescript-in-purescript

PureScript compiler written in PureScript

purescript-in-purescript's People

Contributors

garyb avatar paf31 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

purescript-in-purescript's Issues

Avoid hacky usage of `argv` in `Language.PureScript.Prelude`

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"
               ]

Make failed

2f8352d

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?

Remaining Modules

@garyb

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.

  • Code Generator (Simple but large modules)
    • src/Language/PureScript/CodeGen/Common.hs
    • src/Language/PureScript/CodeGen/Externs.hs
    • src/Language/PureScript/CodeGen/JS/AST.hs
    • src/Language/PureScript/CodeGen/JS.hs
  • Optimizer (medium, low priority)
    • src/Language/PureScript/Optimizer/Blocks.hs
    • src/Language/PureScript/Optimizer/Common.hs
    • src/Language/PureScript/Optimizer/Inliner.hs
    • src/Language/PureScript/Optimizer/MagicDo.hs
    • src/Language/PureScript/Optimizer/TCO.hs
    • src/Language/PureScript/Optimizer/Unused.hs
  • Data Types
    • src/Language/PureScript/Declarations.hs
    • src/Language/PureScript/Environment.hs
    • src/Language/PureScript/Errors.hs
    • src/Language/PureScript/Kinds.hs
    • src/Language/PureScript/Options.hs
    • src/Language/PureScript/Names.hs
    • src/Language/PureScript/TypeClassDictionaries.hs
    • src/Language/PureScript/Types.hs
  • Parser
    • src/Language/PureScript/Parser/Common.hs
    • src/Language/PureScript/Parser/Declarations.hs
    • src/Language/PureScript/Parser/Kinds.hs
    • src/Language/PureScript/Parser/Types.hs
  • Pretty Printer (Difficult)
    • src/Language/PureScript/Pretty/Common.hs
    • src/Language/PureScript/Pretty/JS.hs
    • src/Language/PureScript/Pretty/Kinds.hs
    • src/Language/PureScript/Pretty/Types.hs
    • src/Language/PureScript/Pretty/Values.hs
  • Desugaring Steps
    • src/Language/PureScript/Sugar/BindingGroups.hs
    • src/Language/PureScript/Sugar/CaseDeclarations.hs
    • src/Language/PureScript/Sugar/DoNotation.hs
    • src/Language/PureScript/Sugar/Names.hs
    • src/Language/PureScript/Sugar/Operators.hs
    • src/Language/PureScript/Sugar/TypeClasses.hs
    • src/Language/PureScript/Sugar/TypeDeclarations.hs
    • src/Language/PureScript/Sugar.hs
  • Type Checker (Difficult)
    • src/Language/PureScript/TypeChecker/Kinds.hs
    • src/Language/PureScript/TypeChecker/Monad.hs
    • src/Language/PureScript/TypeChecker/Synonyms.hs
    • src/Language/PureScript/TypeChecker/Types.hs
    • src/Language/PureScript/TypeChecker.hs
  • Other
    • src/Language/PureScript/DeadCodeElimination.hs
    • src/Language/PureScript/Constants.hs
    • src/Language/PureScript/ModuleDependencies.hs
    • src/Language/PureScript/Supply.hs
    • src/Language/PureScript/Traversals.hs
    • src/Language/PureScript.hs

Parsing is slow

The parser is slow on anything but the smallest of inputs. It is probably related to the way purescript-parsing works.

Bug when lexing comments

Any single line comment beginning with more than two dashes gets lexed as a symbol, and not as a comment.

Implement the optimizer

  • src/Language/PureScript/Optimizer/Blocks.hs
  • src/Language/PureScript/Optimizer/Common.hs
  • src/Language/PureScript/Optimizer/Inliner.hs
  • src/Language/PureScript/Optimizer/MagicDo.hs
  • src/Language/PureScript/Optimizer/TCO.hs
  • src/Language/PureScript/Optimizer/Unused.hs
  • src/Language/PureScript/Optimizer.hs

Exceptions handled poorly

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.

Performance Ideas

  • Type checker doesn't use the backtracking of Either, so it could just use exceptions and Eff.
  • Try writing the pretty printers using showsPrec-style pretty printing instead of using pattern-arrows.

We should also try to profile the running Javascript to see where the bottleneck is.

Make use of travis

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.

Type pretty printer doesn't terminate

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.

purescript-arrays doesn't compile

โžœ  purescript-arrays git:(master) psc2 src/**/*.purs bower_components/purescript-*/src/**/*.purs
Expected RBrace, found LName ("in") at line 209, column 46

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.