GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - purescript-python/purescript-python: A Python backend for PureScript.

BranchesTags
Open more actions menu

Latest commit

 

History

132 Commits
132 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
app
app
 
 
licenses/direct-from-purescript
licenses/direct-from-purescript
 
 
passing
passing
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
ChangeLog.md
ChangeLog.md
 
 
FFITestsSummary.md
FFITestsSummary.md
 
 
Impl.md
Impl.md
 
 
Interops.md
Interops.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Setup.hs
Setup.hs
 
 
ci-passing.sh
ci-passing.sh
 
 
package.yaml
package.yaml
 
 
stack.yaml
stack.yaml
 
 
travis-env.py
travis-env.py
 
 
travis-env.sh
travis-env.sh
 
 

Repository files navigation

PureScript to Python Compiler

Build Status gitter room install py interop

  • Specification and Implementation
  • Example Project

Get Started

  1. *Install a CPython distribution.

    If you're already a user of CPython, you can skip this step.

    Otherwise, go to this official download page, download and install any valid distribution(>=3.5, <=3.8).

  2. Install nodejs, which is distributed with a command npm, and use npm to install purescript and its package manager spago. The latest version of the purescript compiler that is supported is 0.13.8:

    npm install -g purescript
    npm install -g spago

    You might check PureScript: Getting Started for more details.

  3. Install PureScript-Python components:

    curl -fsSL https://raw.githubusercontent.com/purescript-python/installer/master/install.sh | bash

  4. Create an empty folder called hello-world somewhere appropriate,get in, and call

    spago init  # init purescript project
    pspy --init # init purescript-python local configuration
    
  5. Add a key backend with value "pspy", to file spago.dhall of your hello-world project. This is an example:

     {-
     Welcome to a Spago project!
     You can edit this file as you like.
     -}
     { name = "my-project"
     , dependencies = [ "console", "effect", "psci-support" ]
     , packages = ./packages.dhall
     , sources = [ "src/**/*.purs", "test/**/*.purs" ]
     , backend = "pspy" -- !!NOTE THIS!!
     }
  6. Write your code in src/**.purs, and use spago run to execute your project(the default entry module is Main).

PureScript Learning Materials

PureScript is close to Haskell, hence a Haskell user can pick it up in few seconds.

The home of PureScript is PureScript.org, where you can find things involving documentations.

HOW-TO: IDE Support

A major motivation for my working on PureScript is its lightweighted but awesome IDE support.

For VSCode users, installing the plugin PureScript IDE and File -> Preferences -> Settings -> (search purescript) -> Turn on "Add Spago sources" will be sufficient. No need to install some GitHub repo and build for 4 hours! And this IDE feels swift!

Troubleshoot pspy-blueprint

If pspy-blueprint provided by the Python package purescripto didn't work(e.g., users of MacOSX < 10.15), you should manually install it from this repository, and currently there're 2 options:

  1. Install from GitHub release page.
  2. Install from source(Need Haskell stack): clone this repo, and use command stack install ., which will install pspy-blueprint to your .local PATH.

For Linux users, you might also need to use chmod u+x <path/to/pspy-blueprint> to allow the permission to execute.

Troubleshoot: Execution Not Sync to Latest Code

This seems to be a recent issue produced by the upstream compiler, and you can resolve this by removing the current output directory:

rm -rf $YOUR_PROJECT_ROOT/output && spago build && pspy --run

This will produce the result of your latest code.

About

A Python backend for PureScript.

Topics

compilerpurescriptpython

Resources

Readme
MIT license
Activity
Custom properties

Stars

124 stars

Watchers

12 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.