Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hs2js package / tidal parser #870

Merged
merged 50 commits into from
May 19, 2024
Merged

hs2js package / tidal parser #870

merged 50 commits into from
May 19, 2024

Conversation

felixroos
Copy link
Collaborator

@felixroos felixroos commented Dec 21, 2023

experiment on bringing a haskell parser into the browser

edit from the future:

example usage:

await initTidal()

tidal`
d1 
$ sub (note "12 0")
$ sometimes (|+ note "12")
$ jux rev $ voicing $ n "<0 5 4 2 3(3,8)/2>*8"
# chord "<Dm Dm7 Dm9 Dm11>"
# dec 0.5 # delay 0.5 # room 0.5 # vib "4:.25"
# crush 8 # s "sawtooth" # lpf 800 # lpd 0.1
# dist 1

d2 
$ s "RolandTR909_bd*4, hh(10,16), oh(-10,16)"
# clip (range 0.1 0.9 $ fast 5 $ saw)
# release 0.04 # room 0.5
`

all(x=>x._punchcard())

@felixroos
Copy link
Collaborator Author

waiting for tree-sitter/tree-sitter-haskell#108

@felixroos
Copy link
Collaborator Author

here's a little haskell / tree-sitter playground https://github.com/felixroos/haskell-tree-sitter-playground/

@felixroos
Copy link
Collaborator Author

waiting for tree-sitter/tree-sitter-haskell#108

it looks like this is not going to happen anytime soon. So to properly parse tidal style haskell, another parser has to be used :'(

@yaxu
Copy link
Member

yaxu commented Mar 25, 2024

Nice to see a draft PR on tree-sitter-haskell with the support for # operators

@felixroos
Copy link
Collaborator Author

Nice to see a draft PR on tree-sitter-haskell with the support for # operators

yes, there is hope there is hope: tree-sitter/tree-sitter-haskell#120

@felixroos felixroos changed the title tree-sitter haskell parser experiment tidal mode May 16, 2024
@felixroos felixroos changed the title tidal mode hs2js package / tidal parser May 17, 2024
@felixroos felixroos marked this pull request as ready for review May 18, 2024 22:09
@felixroos
Copy link
Collaborator Author

The general mechanism seems to be in place, now it's just a matter of implementing all missing operators and functions. Due to a non-existing type system + slight differences between strudel/superdough and tidal/superdirt we can't get a 100% match, but we can get close.
Maybe it makes sense to merge this as is, so people can play with it and give feedback?

@felixroos felixroos requested review from yaxu and daslyfe May 18, 2024 22:43
@yaxu
Copy link
Member

yaxu commented May 18, 2024

I don't see why not!

@felixroos
Copy link
Collaborator Author

for some reason, github actions doesn't understand symlinks, so when using the workspace version of hs2js, the postinstall task fails. For this reason I've now pinned hs2js on 0.0.8 (one version behind workspace), causing it to not create a symlink.. the version picked in the website package is for the wasm files anyway so it only has to be updated when they change. maybe a better solution can be found in the future: #1106

@felixroos felixroos merged commit 25064b4 into main May 19, 2024
2 checks passed
@felixroos felixroos deleted the haskell-parser branch May 19, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants