All Projects → purescript-python → Purescript Python

purescript-python / Purescript Python

Licence: mit
A Python backend for PureScript.

Programming Languages

python
139335 projects - #7 most used programming language
purescript
368 projects

Labels

Projects that are alternatives of or similar to Purescript Python

Selfie
An educational software system of a tiny self-compiling C compiler, a tiny self-executing RISC-V emulator, and a tiny self-hosting RISC-V hypervisor.
Stars: ✭ 1,318 (+1179.61%)
Mutual labels:  compiler
Artist
ARTist's core implementation meant to be included in the art project. Provides ARTist APIs and boilerplate code for modules.
Stars: ✭ 97 (-5.83%)
Mutual labels:  compiler
Vc4c
Compiler for the VC4CL OpenCL implementation
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler
Pyast64
Compile a subset of the Python AST to x64-64 assembler
Stars: ✭ 93 (-9.71%)
Mutual labels:  compiler
Fetlang
Fetish-themed programming language
Stars: ✭ 1,337 (+1198.06%)
Mutual labels:  compiler
Faust
Functional programming language for signal processing and sound synthesis
Stars: ✭ 1,360 (+1220.39%)
Mutual labels:  compiler
Wasm Forth
A Forth implementation compiling to WebAssembly.
Stars: ✭ 92 (-10.68%)
Mutual labels:  compiler
Fcc
Fedjmike's C Compiler
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler
Evm2wasm
[ORPHANED] Transcompiles EVM code to eWASM
Stars: ✭ 96 (-6.8%)
Mutual labels:  compiler
Lixincompiler
参考自龙书上的语言,自己实现了一个编译器的前端。
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler
Ngraph
nGraph has moved to OpenVINO
Stars: ✭ 1,322 (+1183.5%)
Mutual labels:  compiler
Dataformsjs
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.
Stars: ✭ 95 (-7.77%)
Mutual labels:  compiler
Bqn
An APL-like programming language. Self-hosted!
Stars: ✭ 100 (-2.91%)
Mutual labels:  compiler
Amplifier.net
Amplifier allows .NET developers to easily run complex applications with intensive mathematical computation on Intel CPU/GPU, NVIDIA, AMD without writing any additional C kernel code. Write your function in .NET and Amplifier will take care of running it on your favorite hardware.
Stars: ✭ 92 (-10.68%)
Mutual labels:  compiler
Nanojit
NanoJIT is a small, cross-platform C++ library that emits machine code.
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler
Scheje
A little scheme implementation on top of Clojure
Stars: ✭ 92 (-10.68%)
Mutual labels:  compiler
Numba Scipy
numba_scipy extends Numba to make it aware of SciPy
Stars: ✭ 98 (-4.85%)
Mutual labels:  compiler
Hissp
It's Python with a Lissp.
Stars: ✭ 102 (-0.97%)
Mutual labels:  compiler
Zxbasic
The Sinclair ZX Spectrum BASIC compiler!
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler
Fanx
A portable programming language
Stars: ✭ 101 (-1.94%)
Mutual labels:  compiler

PureScript to Python Compiler

Build Status gitter room install py interop

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).

  2. Install nodejs, which is distributed with a command npm, and use npm to install purescript and its package manager spago:

    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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].