Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a2ae7d9
Rename 'Call' to 'StackExpand` in IR, Raw, and Stack
ssoelvsten Sep 25, 2025
a09956f
Improve lib record export syntax
ssoelvsten Sep 25, 2025
414f41a
Manifest design of the Standard Library in its README
ssoelvsten Sep 26, 2025
affd85d
Set up Dependabot to keep an eye on Action dependencies
ssoelvsten Sep 29, 2025
9d93c51
Fix 'Data.ByteString.getLine' is deprecated
ssoelvsten Sep 29, 2025
a506c00
Rename 'make all' to 'make build' to match conventions
ssoelvsten Sep 29, 2025
f548e05
Remove verbosity if not otherwise requested
ssoelvsten Sep 29, 2025
09bb4cb
Separate build step from installation (readding 'all' target)
ssoelvsten Sep 29, 2025
cc63946
Move 'ghci' targets to the end and differentiate with '/' rather than…
ssoelvsten Sep 30, 2025
670b59f
Some clean up in Stack2JS
ssoelvsten Oct 1, 2025
7038652
Fix misalignment
ssoelvsten Oct 1, 2025
45588a7
Fix whitespace and some comments
ssoelvsten Oct 1, 2025
9749bbe
Fix typo 'GENARTING'
ssoelvsten Oct 1, 2025
89f401b
Comments, formatting, and clean up of Main.hs pipeline
ssoelvsten Oct 1, 2025
22d8ed8
Move compilation of 'trp-rt/' into the subfolder
ssoelvsten Oct 2, 2025
d86157f
Remove 'troupec -l' option short-hand
ssoelvsten Oct 2, 2025
06a8f9a
Remove '-i' and '-j' as short-hand options
ssoelvsten Oct 2, 2025
9f36e00
Clean up in .gitignore
ssoelvsten Oct 2, 2025
f4903f8
Move ppDeps from IR to Stack2JS
ssoelvsten Oct 2, 2025
ccce336
Remove/Clean up some dead code
ssoelvsten Oct 2, 2025
f44609f
Simplify 'irProg2JSString'
ssoelvsten Oct 2, 2025
6e463ce
Rename 'debugOut' to 'debugMode' to better convey its meaning
ssoelvsten Oct 2, 2025
2aa23a5
Remove outdated and empty project files for compiler
ssoelvsten Oct 3, 2025
23a386b
Output parsed syntax when verbose
ssoelvsten Oct 4, 2025
1577bcc
Remove generation of dead code 'this.loadLibs' preamble of JS output
ssoelvsten Oct 6, 2025
3c4d9ee
Remove magic (dependant) constant
ssoelvsten Oct 6, 2025
2cc1c44
Inline 'App.hs/fromFile' to improve code clarity
ssoelvsten Oct 6, 2025
0a73eea
Move print helpers up to the function that uses it
ssoelvsten Oct 6, 2025
6429a3c
Clean up and simplify main interface for Stack2JS.hs
ssoelvsten Oct 14, 2025
13f919d
Extend usage of 'CompileMode' to also accomodate 'Interactive Mode'
ssoelvsten Oct 14, 2025
f6848aa
Remove dead and deprecated code 'loadLibs.mts'
ssoelvsten Oct 6, 2025
63ebf35
Remove dead code and clean up string with JS preamble during deserial…
ssoelvsten Oct 6, 2025
dbed8ce
Cleanup in 'deserialize.mts'
ssoelvsten Oct 6, 2025
212edfc
Remove dead code in 'deserialize.mts'
ssoelvsten Oct 6, 2025
d935719
Cleanup in 'loadLibsAsync.mts'
ssoelvsten Oct 6, 2025
8fb77e9
Cleanup in 'runtimeMonitored.mts'
ssoelvsten Oct 7, 2025
2577061
Fix very odd inline import
ssoelvsten Oct 14, 2025
1d7adcf
Improve naming and documentation for thread epilogues
ssoelvsten Oct 14, 2025
094dc9e
Remove dead(ish) code in 'Scheduler.mts'
ssoelvsten Oct 15, 2025
ad318df
Reorder and add some documentation to Scheduler
ssoelvsten Oct 15, 2025
8bcaa1d
Remove unused default arguments
ssoelvsten Oct 15, 2025
146070e
Add types to more Scheduler functions
ssoelvsten Oct 15, 2025
a042ddc
Remove dead code '__unit' variable
ssoelvsten Oct 15, 2025
69ae9f5
Remove dead code 'stackcounter'
ssoelvsten Oct 15, 2025
308e945
Reorder imports for Scheduler
ssoelvsten Oct 15, 2025
fb10410
Simplify 'scheduleNewThreadAtLevel'
ssoelvsten Oct 15, 2025
9d5aeec
Remove unused variable 'STACKDEPTH'
ssoelvsten Oct 15, 2025
9be733d
Use typescript enum for 'TerminationStatus'
ssoelvsten Oct 15, 2025
a39c9a2
Sort through Scheduler state
ssoelvsten Oct 15, 2025
4e0a990
Initialise arrays consistently
ssoelvsten Oct 15, 2025
930ba69
Fix whitespace and missing semicolons in Scheduler
ssoelvsten Oct 15, 2025
77e1325
Replace thread blocking queue with a map
ssoelvsten Oct 15, 2025
731c0fa
Remove '__alive' from public Scheduler interface
ssoelvsten Oct 15, 2025
64a0096
Sort through and add some types for SchedulerInterface
ssoelvsten Oct 15, 2025
f40deab
Remove unused logger
ssoelvsten Oct 15, 2025
3e9b19a
Only show stack if flag is set (as is documented)
ssoelvsten Oct 15, 2025
ba464f9
Remove dead code in tight scheduling loop
ssoelvsten Oct 15, 2025
36788bd
Clean up 'Scheduler.loop()'
ssoelvsten Oct 15, 2025
64f8afa
Replace optional arguments for newly scheduled threads with an enum
ssoelvsten Oct 15, 2025
0ff9693
Remove dead code 'schedule(...)'
ssoelvsten Oct 15, 2025
99ce9e9
Simplify name of 'scheduleNewThread...'
ssoelvsten Oct 15, 2025
b37e64b
Stop exposing/using internal (private) variable within Scheduler
ssoelvsten Oct 15, 2025
af32ef7
Skip execution of dead threads
ssoelvsten Oct 15, 2025
a4b1640
Comment and reorder 'start(..)'
ssoelvsten Oct 16, 2025
c7c2576
Turn thread termination resolution into a callback
ssoelvsten Oct 20, 2025
7b9a856
Fix indentation to better convey how the paragraphs fit together
ssoelvsten Oct 20, 2025
79c172a
Clean up comments for 'resetScheduler'
ssoelvsten Oct 20, 2025
69b58d9
Add '__userRuntime' to interface since it is not kept private
ssoelvsten Oct 20, 2025
806c940
Rewrite deserialization to use a queue and async functions
ssoelvsten Nov 17, 2025
a6b9aa7
Add modules to compiler (WIP)
ssoelvsten Sep 29, 2025
3fc49d1
Fix final js is not outputted anymore when verbose
ssoelvsten Oct 20, 2025
79e528c
Prune unused modules at the IR function level
ssoelvsten Oct 4, 2025
08ef4c7
Throw error on module name collision
ssoelvsten Oct 6, 2025
df9f6e0
Set up scheduler to run code prior to 'main' thread without exiting
ssoelvsten Oct 16, 2025
f8fec9a
Update 'local.sh' to also keep '-i <..>' and '--include=<...>' for ru…
ssoelvsten Oct 20, 2025
16bbef7
Look up 'lib/' folder by default for modules
ssoelvsten Oct 20, 2025
2fb2923
Replace library imports with new local module system
ssoelvsten Oct 7, 2025
545ce87
HACK: compile lib/ as modules
ssoelvsten Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ jobs:
echo "Runtime built successfully, troupe.mjs found"
- name: compile lib
run: make lib
- name: compile service
run: make service
- name: compile trp-rt
run: make trp-rt
- name: run basic test
run: ./local.sh tests/rt/pos/core/fib10.trp
- name: run ci network test
Expand Down
74 changes: 50 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,61 @@
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.DS_Store
*.dyn_o
*.dyn_hi
.hpc
.hsenv
TAGS

##################################################
# NPM
node_modules

##################################################
# Haskell

## Cabal Sandbox
.cabal-sandbox/
cabal.sandbox.config
cabal.project.local

## Program Coverage
.hpc
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
.HTF/
TAGS
*.vscode
/out

## Test Framework
.HTF

## Virtual Environment
.hsenv

## Build files
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi

##################################################
# Binaries from `compiler`
bin/*
node_modules
yarn.lock
yarn-error.log

##################################################
# Troupe Compiler (`troupec`) output
out/*

##################################################
# Editors

## Visual Studio Code
*.vscode

## Vi
*.swp
bin/troupe
bin/understudy
trp-rt/out/

## Emacs
*.#*
*~

##################################################
# Operating Systems

## MacOS
*.DS_Store
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: rt compiler lib p2p-tools
.PHONY: rt trp-rt compiler lib p2p-tools

# TODO: Rename to 'build/*' ?
all: npm rt compiler p2p-tools lib service
all: npm compiler rt trp-rt p2p-tools lib

npm:
npm install
Expand All @@ -20,16 +20,16 @@ p2p-tools:
lib:
cd lib; $(MAKE) build

service:
mkdir -p ./trp-rt/out
$(COMPILER) ./trp-rt/service.trp -l
trp-rt:
cd trp-rt/; $(MAKE) build

# TODO: Rename to 'clean/*' ?
clean: clean/compiler clean/rt clean/lib
clean: clean/compiler clean/rt clean/trp-rt clean/p2p-tools clean/lib
clean/compiler:
cd compiler; $(MAKE) clean
clean/rt:
cd rt; $(MAKE) clean
clean/trp-rt:
cd lib; $(MAKE) clean
clean/p2p-tools:
cd p2p-tools; $(MAKE) clean
clean/lib:
Expand Down
15 changes: 12 additions & 3 deletions compiler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
##################################################
# Stack artifacts
.stack-work/
stack.yaml.lock

##################################################
# Cabal artifacts
Troupe-compiler.cabal
dist
dist-*
cabal-dev

##################################################
# Local compilation output
ir2raw-out
stack.yaml.lock
*~
out
Empty file removed compiler/ChangeLog.md
Empty file.
30 changes: 0 additions & 30 deletions compiler/LICENSE

This file was deleted.

29 changes: 20 additions & 9 deletions compiler/Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
.PHONY: test

all:
stack -v build $(STACK_OPTS)
all: build install

build: VERBOSITY_FLAG =
build:
stack $(VERBOSITY_FLAG) build $(STACK_OPTS)
build/verbose:
$(MAKE) $(MAKE_FLAGS) build VERBOSITY_FLAG="-v"

install: VERBOSITY_FLAG =
install:
$(MAKE) $(MAKE_FLAGS) build
mkdir -p ./../bin
stack -v install $(STACK_OPTS) --local-bin-path ./../bin/
stack $(VERBOSITY_FLAG) install $(STACK_OPTS) --local-bin-path ./../bin/
install/verbose:
$(MAKE) $(MAKE_FLAGS) install VERBOSITY_FLAG="-v"

clean:
rm *.cabal
stack clean --full
rm -rf ../bin
# If problems still persist after this, remove all GHC compilers in ~/.stack/programs/**/

ghci-irtester:
stack ghci --main-is Troupe-compiler:exe:irtester --no-load

ghci-troupec:
stack ghci --main-is Troupe-compiler:exe:troupec --no-load

test:
stack test $(STACK_OPTS)

parser-info:
stack exec happy -- -i src/Parser.y

ghci/irtester:
stack ghci --main-is Troupe-compiler:exe:irtester --no-load

ghci/troupec:
stack ghci --main-is Troupe-compiler:exe:troupec --no-load
1 change: 0 additions & 1 deletion compiler/README.md

This file was deleted.

Loading
Loading