Compiler frontend for the PureScript programming language.

Overview

purescript-analyzer

Goals

  • Provide an independent frontend for providing information for IDE tooling, separate from the compiler.

  • Implement a rich editing experience for PureScript through incrementality and resiliency.

  • Efficient memory usage (at least lower than the current IDE tooling).

Features

  • Refactorings

  • Auto-completion of syntactic structures

  • Information for local bindings

  • Semantic highlighting (?)

Architecture

  • Christoph: level of incrementality - at the module level

    how much information to recompute on every keystroke e.g.

    type at point, documentation strings, sum type variants imported names, new declarations (global and local)

  • Resilience:

    Information is added even on erroneous syntax trees or stuff that just partially compiles.

Code Related

  • CST - implemented through rowan, which is then lowered to a representation that can be "analyzed"

  • Streams of tokens are parsed into a structured tree w/ respect to the indentation rules

  • Lexer - port over stack machine lexer from the compiler to simplify parsing for indentation rules

  • Name resolution step (should happen on the AST before type checking)

import X (x)

v = x

z = let y = 0 in y
v = X.x

z = let y = 0 in y@ss
  • Type check the "surface" language rather than desugar the surface to a "core" language and then type check. The problem w/ desugaring is that position information can be discarded one way or another.
main = do
  foo <- may error here
  bar <- despite error being here
  baz

or some other example.

  • Type system (constraint-based/bidirectional)--bidirectional type checking can be a bit more local(?)

  • Figure out how to store/load information after type checking based on the current context

main =
  let
    x = 0
    y = 1
  in
    x  -- cursor here

Can be type-directed search then return the current environment.

  • Boundaries between declarations
x =
y = 0

x = {};
y = {0};
  • Parser resilience (stuff like mismatched parentheses, indentation in do blocks)
You might also like...
Nexa programming language. A language for game developers by a game developer
Nexa programming language. A language for game developers by a game developer

NexaLang Nexa programming language. A language for game developers by a game developer. Features High-Level: Nexa is an easy high level language Two M

Compiler for an "extended" version of the Mindustry logic language

Minblur Compiler Minblur is a compiler for a superset of "logic" programming language in the game Mindustry. It helps reduce code-duplication, making

An awesome language and its compiler.

Calocom Project Build Build with cargo-make Just run cargo make in the root directory of the project. Or, if you want to build it in release mode, run

Open-source compiler for the Papyrus scripting language of Bethesda games.

Open Papyrus Compiler This project is still WORK IN PROGRESS. If you have any feature requests, head over to the Issues tab and describe your needs. Y

An interpreter and compiler for the Brainfuck language.

Brainrust 🧠 An interpreter and compiler for the Brainfuck language. Prerequisites You need a LLVM 16.0.* installation on your system. On Windows, you

A Text User Interface library for the Rust programming language
A Text User Interface library for the Rust programming language

Cursive Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but other backends are available. It allows you to build

🎄My Advent of Code 2021 solutions in the Rust programming language

Advent of Code 2021 in Rust My Advent of Code 2021 solutions in the Rust programming language. This repository holds a separate Rust project for each

Yfin is the Official package manager for the Y-flat programming language
Yfin is the Official package manager for the Y-flat programming language

Yfin is the Official package manager for the Y-flat programming language. Yfin allows the user to install, upgrade, and uninstall packages. It also allows a user to initialize a package with the Y-flat package structure and files automatically generated. In future, Yfin will also allow users to publish packages.

A Text User Interface library for the Rust programming language
A Text User Interface library for the Rust programming language

Cursive Cursive is a TUI (Text User Interface) library for rust. It uses ncurses by default, but other backends are available. It allows you to build

Comments
  • numbers and testing infrastructure

    numbers and testing infrastructure

    • Add helper functions for faster lexer tests
    • Parse scientific notation and underscores
    • Add some comments about how to parse purescript numbers
    • Add tests for underscores
    • Cargo build and test CI
    opened by FredTheDino 0
Owner
Justin Garcia
@purescript core team member and avid rhythm gamer
Justin Garcia
Programming language made by me to learn other people how to make programming languages :3

Spectra programming language Programming language made for my tutorial videos (my youtube channel): Syntax Declaring a variable: var a = 3; Function

Adi Salimgereyev 3 Jul 25, 2023
a (soon to be) calculator frontend and a (soon to be optimizing) toy IR backend

Zach-Calc Zach-Calc is a pet project for me to try and better understand pattern matching, optimization, IRs, and the likes. ./libs/* contains librari

Zachary Petti 0 Jan 6, 2022
Macchina - A system information frontend, with an (unhealthy) emphasis on performance.

macchina Fast, minimal and customizable system information frontend. Linux • macOS • Windows • NetBSD • FreeBSD • OpenWrt • Android About macchina let

Macchina CLI 682 Jan 5, 2023
Simple TUI frontend for paru,

parui Simple TUI frontend for paru. Images Keybinds parui adopts vim-like keybinds. Key Mode Action <Escape> Insert Enter Select Mode <Return> Insert

Qther 25 Jan 3, 2023
Yet another command-line chat GPT frontend written in Rust.

gpterm Yet another command-line chat GPT frontend written in Rust. Features Stream output with typing effect Store chat messages/history Context aware

Makis Christou 22 May 4, 2023
A piet frontend for tiny-skia

piet-tiny-skia A piet frontend for the tiny-skia framework. tiny-skia is a very high-quality implementation of software rendering, based on the algori

John Nunley 4 Aug 4, 2023
Experimental integration of `fedimint-client` with the Leptos web frontend framework

CAUTION: highly experimental, the Database implementation is likely horribly broken Fedimint Client built with Leptos This repo contains a proof-of-co

null 3 Aug 27, 2023
💸 An open-source wasteof.money frontend/backend implementation

wasteof.time An open-source wasteof.money frontend/backend implementation Running Backend cargo run -q -p backend Frontend To run the frontend, you ne

Max Walters 3 Feb 18, 2024
Progress In Nix - Pacman inspired frontend for Nix

Progress In Nix Pinix is a Pacman inspired frontend for Nix. It wraps a regular Nix command and replaces the output with a more modern and informative

Rémi Dupré 23 Mar 9, 2024
The Amp programming language: a language designed for building high performance systems.

A language designed for building high performance systems. Platform Support x86_64-pc-windows ✅ x86_64-unknown-linux ⚠️ untested x86_64-unknown-darwin

The Amp Programming Language 5 Mar 17, 2023