Page 16 of 17

Re: Brassica SCA [online version]

Posted: Fri Mar 07, 2025 1:26 am
by Lērisama
bradrn wrote: Thu Mar 06, 2025 9:34 pm Also on the to-do list. (It certainly isn’t implemented, so I’m not sure why Lērisama isn’t getting a syntax error…) The problem was I couldn’t think of any places I could use it myself, so I wasn’t quite sure how to design it. Your examples are helpful in that!
Given WarpedWartWars pointing out of my error, it seems like brassica just ignoresIt's just ignoring the second exception. This is if anything less helpful than a syntax error.



While investigating the github for anything that might help with building Brassica for arm, I was reminded of the unstatisfatory behaviour of the Kleene star, and had an idea for it, which should hopefully be slightly less confusing, although I don't know how easy it would be to implement. Brassica would initially check for matches of the item after the star, and only check for matches of the starred item if it wasn't found. The old behaviour culd be toggled on with a flag, something like -g maybe¹²?



My first question about the building has come! Cabal has been claiming to be Redirecting build log to {handle:
<LONG FILE NAME>}
for around 12 hours now, but hasn't given any errors and otherwise seems to be working. Either this is an abnormally long log file, or something has gone wrong, and I don't hold up much hope for the latter⁴.

¹ For greedy
² Or maybe brassica should output both options, unless it's specifically told to be -g or -ng³
³ Unsurprisingly, for not greedy
⁴ I have a horrible suspicion it's running out of memory, and I'll have to set up some kind of hack to work around that, but I'd have thought it would stop with an error in that case

Re: Brassica SCA [online version]

Posted: Fri Mar 07, 2025 2:25 am
by bradrn
Lērisama wrote: Fri Mar 07, 2025 1:26 am While investigating the github for anything that might help with building Brassica for arm, I was reminded of the unstatisfatory behaviour of the Kleene star, and had an idea for it, which should hopefully be slightly less confusing, although I don't know how easy it would be to implement. Brassica would initially check for matches of the item after the star, and only check for matches of the starred item if it wasn't found.
But what happens if the Kleene star is at the end of the target? Then there is no ‘item after’. (Another difficulty is that Brassica, as currently architected, has no access to the next item at all, though that could be changed.)
My first question about the building has come! Cabal has been claiming to be Redirecting build log to {handle:
<LONG FILE NAME>}
for around 12 hours now, but hasn't given any errors and otherwise seems to be working. Either this is an abnormally long log file, or something has gone wrong, and I don't hold up much hope for the latter⁴.
Yes, that sounds like something gone wrong. In fact, it sounds vaguely familiar from when I last tried to use Haskell on Raspberry Pi many years ago.

What happens if you terminate it and look at the log file?
⁴ I have a horrible suspicion it's running out of memory, and I'll have to set up some kind of hack to work around that, but I'd have thought it would stop with an error in that case
From memory, this case is signalled by the slightly bizarre message ‘Error -12’. Of course you could always check the memory usage to rule this out.

Re: Brassica SCA [online version]

Posted: Fri Mar 07, 2025 2:40 pm
by Lērisama
bradrn wrote: Fri Mar 07, 2025 2:25 am But what happens if the Kleene star is at the end of the target? Then there is no ‘item after’. (Another difficulty is that Brassica, as currently architected, has no access to the next item at all, though that could be changed.)
In that case, the greedy¹ behaviour would have to be mandatory. It's not ideal, but I think it might be slightly more intuitive than the current version. I'm not sure.

Yes, that sounds like something gone wrong. In fact, it sounds vaguely familiar from when I last tried to use Haskell on Raspberry Pi many years ago.

What happens if you terminate it and look at the log file?
It is the following². I don't know anything about haskell, so I'm posting it on here. The only thing that looks immediately odd to me are the various lines near the bottom of No <package?> found.
More: show

Code: Select all

Using Parsec parser
Configuring library for network-uri-2.6.4.2..
Dependency base ==4.15.1.0: using base-4.15.1.0
Dependency deepseq ==1.4.5.0: using deepseq-1.4.5.0
Dependency parsec ==3.1.14.0: using parsec-3.1.14.0
Dependency template-haskell ==2.17.0.0: using template-haskell-2.17.0.0
Dependency th-compat ==0.1.6: using th-compat-0.1.6
Source component graph: component lib
Configured component graph:
    component network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91
        include base-4.15.1.0
        include deepseq-1.4.5.0
        include parsec-3.1.14.0
        include template-haskell-2.17.0.0
        include th-compat-0.1.6-852cffa3ddf96f4c1933f5aa20a0a1ffd34b4e10eaeca5f8a3cd1bb0a8c10a89
Linked component graph:
    unit network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91
        include base-4.15.1.0
        include deepseq-1.4.5.0
        include parsec-3.1.14.0
        include template-haskell-2.17.0.0
        include th-compat-0.1.6-852cffa3ddf96f4c1933f5aa20a0a1ffd34b4e10eaeca5f8a3cd1bb0a8c10a89
        Network.URI=network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91:Network.URI,Network.URI.Lens=network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91:Network.URI.Lens,Network.URI.Static=network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91:Network.URI.Static
Ready component graph:
    definite network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91
        depends base-4.15.1.0
        depends deepseq-1.4.5.0
        depends parsec-3.1.14.0
        depends template-haskell-2.17.0.0
        depends th-compat-0.1.6-852cffa3ddf96f4c1933f5aa20a0a1ffd34b4e10eaeca5f8a3cd1bb0a8c10a89
Using Cabal-3.4.1.0 compiled by ghc-9.0
Using compiler: ghc-9.0.2
Using install prefix:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91
Executables installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/bin
Libraries installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/lib
Dynamic Libraries installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/lib
Private executables installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/libexec
Data files installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/share
Documentation installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/share/doc
Configuration files installed in:
~/.cabal/store/ghc-9.0.2/network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91/etc
No alex found
Using ar found on system at: /usr/bin/aarch64-linux-gnu-ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 12 found on system at: /usr/bin/aarch64-linux-gnu-gcc
Using ghc version 9.0.2 given by user at: /usr/bin/ghc
Using ghc-pkg version 9.0.2 given by user at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.25.1 found on system at: /usr/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.68 found on system at: /usr/bin/hpc
Using hsc2hs version 0.68.7 found on system at: /usr/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at: /usr/bin/aarch64-linux-gnu-ld.gold
Using pkg-config version 1.8.1 found on system at: /usr/bin/pkg-config
Using runghc version 9.0.2 found on system at: /usr/bin/runghc
Using strip version 2.40 found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
Component build order: library
/usr/bin/ghc-pkg init dist/package.conf.inplace
creating dist/build
creating dist/build/autogen
creating dist/build/autogen
Preprocessing library for network-uri-2.6.4.2..
Building library for network-uri-2.6.4.2..
creating dist/build
/usr/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -i. -idist/build/autogen -idist/build/global-autogen -Idist/build/autogen -Idist/build/global-autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -this-unit-id network-uri-2.6.4.2-9b689e3a21f705034141fc61aefabcf88948b40ccba9bc03c510605a5651bd91 -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db ~/.cabal/store/ghc-9.0.2/package.db -package-db dist/package.conf.inplace -package-id base-4.15.1.0 -package-id deepseq-1.4.5.0 -package-id parsec-3.1.14.0 -package-id template-haskell-2.17.0.0 -package-id th-compat-0.1.6-852cffa3ddf96f4c1933f5aa20a0a1ffd34b4e10eaeca5f8a3cd1bb0a8c10a89 -XHaskell98 -XCPP -XDeriveDataTypeable -XDeriveGeneric Network.URI Network.URI.Lens Network.URI.Static -Wall -fwarn-tabs -Winferred-safe-imports -Wmissing-safe-haskell-mode -hide-all-packages
[1 of 3] Compiling Network.URI      ( Network/URI.hs, dist/build/Network/URI.o, dist/build/Network/URI.dyn_o )
⁴ I have a horrible suspicion it's running out of memory, and I'll have to set up some kind of hack to work around that, but I'd have thought it would stop with an error in that case
From memory, this case is signalled by the slightly bizarre message ‘Error -12’. Of course you could always check the memory usage to rule this out.
Thank you for the error code.

¹ i.e. current
² The only change I made was replacing /home/<USERNAME> with ~

Re: Brassica SCA [online version]

Posted: Fri Mar 07, 2025 7:15 pm
by bradrn
Lērisama wrote: Fri Mar 07, 2025 2:40 pm
bradrn wrote: Fri Mar 07, 2025 2:25 am But what happens if the Kleene star is at the end of the target? Then there is no ‘item after’. (Another difficulty is that Brassica, as currently architected, has no access to the next item at all, though that could be changed.)
In that case, the greedy¹ behaviour would have to be mandatory. It's not ideal, but I think it might be slightly more intuitive than the current version. I'm not sure.
The other problem is that it has its own difficult cases. For instance take C* C — this would never match more than one consonant, because the ‘after’ lexeme would immediately match.
Lērisama wrote: Fri Mar 07, 2025 2:40 pm It is the following². I don't know anything about haskell, so I'm posting it on here. The only thing that looks immediately odd to me are the various lines near the bottom of No <package?> found.
At least those lines look perfectly normal. You’re not binding to C (c2hs), or compiling to JavaScript (ghcjs), or using the outdated Utrecht compiler (uhc), etc. etc. It looks like it’s just hanging as soon as it starts compiling — for what reason, I don’t know.

Re: Brassica SCA [online version]

Posted: Sat Mar 08, 2025 4:45 am
by WarpedWartWars
bradrn wrote: Thu Mar 06, 2025 9:34 pm Isn’t this rule the same as t / d / [C V] _ w? Because neither C nor V should match . or #.
that would require that [C V] contain everything but [# .], which isn't guaranteed, and in some cases (i can't think of any examples at the moment, but i'm sure one exists) doesn't even make sense. sure, you could always make a category for everything but [# .], but that's extra work for not a whole lot of result
bradrn wrote: Thu Mar 06, 2025 9:34 pm Still… yeah, I see the attraction. If we had notation for ‘match anything’ (which you requested in your earlier post), then this would straightforwardly be something like [MATCHANYTHING -# -.], using the existing syntax for subtraction. But we don’t. (Yet…)
i think i must've completely skipped over the subtraction syntax when i read the Writing Sound Changes file, or maybe i didn't skip over it but rather just completely forgot about it

Re: Brassica SCA [online version]

Posted: Sat Mar 08, 2025 5:07 am
by bradrn
WarpedWartWars wrote: Sat Mar 08, 2025 4:45 am
bradrn wrote: Thu Mar 06, 2025 9:34 pm Isn’t this rule the same as t / d / [C V] _ w? Because neither C nor V should match . or #.
that would require that [C V] contain everything but [# .], which isn't guaranteed
Really? Why would ⟨.⟩ — presumably a syllable boundary marker — be considered a consonant or vowel? And why would anyone include ⟨#⟩, which is (sort of) built-in syntax, in any category at all?

Re: Brassica SCA [online version]

Posted: Sat Mar 08, 2025 7:57 am
by WarpedWartWars
bradrn wrote: Sat Mar 08, 2025 5:07 am Really? Why would ⟨.⟩ — presumably a syllable boundary marker — be considered a consonant or vowel? And why would anyone include ⟨#⟩, which is (sort of) built-in syntax, in any category at all?
i was thinking more along the lines of "there could be stuff that's in neither [# .] nor [C V]"

Re: Brassica SCA [online version]

Posted: Sat Mar 08, 2025 6:58 pm
by bradrn
WarpedWartWars wrote: Sat Mar 08, 2025 7:57 am
bradrn wrote: Sat Mar 08, 2025 5:07 am Really? Why would ⟨.⟩ — presumably a syllable boundary marker — be considered a consonant or vowel? And why would anyone include ⟨#⟩, which is (sort of) built-in syntax, in any category at all?
i was thinking more along the lines of "there could be stuff that's in neither [# .] nor [C V]"
Hmm, such as…?

Re: Brassica SCA [v1.0.0]

Posted: Tue Mar 11, 2025 4:22 pm
by Lērisama
I have done some more investigation, and there seems to be two connected problems¹:
  • Not even one package compiles successfully, so I can't just run the packages one-by-one
  • Both RAM and swap space are consistently over 80% full once it starts hanging, and tending upwards. Given I know nothing interesting happens when I leave it overnight, I terminated once it was clear that the computer was also growing significantly slower
I'm not sure what to do at this point. I assume there are things I can do to increase the swap space, or otherwise increase usable memory space, but I don't have any experience of this, so I thought I'd ask for ideas.

Bradrn, does there happen to be a relatively small² package without dependencies, I could use as a test?

¹ Not really prototypical problems. More like inconvenient facts really
² As in, smaller than the first one to compile

Re: Brassica SCA [v1.0.0]

Posted: Tue Mar 11, 2025 8:27 pm
by bradrn
Lērisama wrote: Tue Mar 11, 2025 4:22 pm Bradrn, does there happen to be a relatively small² package without dependencies, I could use as a test?
I suggest starting by compiling a single file, say:

Code: Select all

main = putStrLn "Hello World"
Run ghc helloworld.hs — does it work?

Re: Brassica SCA [v1.0.0]

Posted: Wed Mar 12, 2025 3:41 pm
by Lērisama
bradrn wrote: Tue Mar 11, 2025 8:27 pm I suggest starting by compiling a single file, say:

Code: Select all

main = putStrLn "Hello World"
Run ghc helloworld.hs — does it work?
It did work¹ and even ran properly. Thank you!

¹ Once I'd fixed the inevitable typos, of course

Re: Brassica SCA [v1.0.0]

Posted: Wed Mar 12, 2025 8:18 pm
by bradrn
Lērisama wrote: Wed Mar 12, 2025 3:41 pm
bradrn wrote: Tue Mar 11, 2025 8:27 pm I suggest starting by compiling a single file, say:

Code: Select all

main = putStrLn "Hello World"
Run ghc helloworld.hs — does it work?
It did work¹ and even ran properly. Thank you!

¹ Once I'd fixed the inevitable typos, of course
Hmm, OK. Now try a Cabal project — cabal init -i in a directory (choose to make an executable project), then cabal run.

Re: Brassica SCA [v1.0.0]

Posted: Thu Mar 13, 2025 3:15 pm
by Lērisama
It compiles successfully, but I haven't been able to run it

Re: Brassica SCA [v1.0.0]

Posted: Thu Mar 13, 2025 7:58 pm
by bradrn
Lērisama wrote: Thu Mar 13, 2025 3:15 pm It compiles successfully, but I haven't been able to run it
…and what exactly happens when you try to run it?

Re: Brassica SCA [v1.0.0]

Posted: Fri Mar 14, 2025 4:07 pm
by Lērisama
bradrn wrote: Thu Mar 13, 2025 7:58 pm
Lērisama wrote: Thu Mar 13, 2025 3:15 pm It compiles successfully, but I haven't been able to run it
…and what exactly happens when you try to run it?
It outputs

Code: Select all

Up to date
Hello, Haskell!
someFunc
After some googling today, I understand this is the default package. I have no idea why it's compiling that instead of helloworld.hs

Re: Brassica SCA [v1.0.0]

Posted: Fri Mar 14, 2025 7:37 pm
by bradrn
Lērisama wrote: Fri Mar 14, 2025 4:07 pm
bradrn wrote: Thu Mar 13, 2025 7:58 pm
Lērisama wrote: Thu Mar 13, 2025 3:15 pm It compiles successfully, but I haven't been able to run it
…and what exactly happens when you try to run it?
It outputs

Code: Select all

Up to date
Hello, Haskell!
someFunc
After some googling today, I understand this is the default package. I have no idea why it's compiling that instead of helloworld.hs
Because this is what the default package is. It wasn’t meant to compile helloworld.hs at all (look in the Cabal file for details). This output shows that it’s working successfully.

So… hmm, not sure. I’ll have to think about this.

Re: Brassica SCA [v1.0.0]

Posted: Sat Mar 15, 2025 5:48 am
by Lērisama
bradrn wrote: Fri Mar 14, 2025 7:37 pm
Lērisama wrote: Fri Mar 14, 2025 4:07 pm
bradrn wrote: Thu Mar 13, 2025 7:58 pm

…and what exactly happens when you try to run it?
It outputs

Code: Select all

Up to date
Hello, Haskell!
someFunc
After some googling today, I understand this is the default package. I have no idea why it's compiling that instead of helloworld.hs
Because this is what the default package is. It wasn’t meant to compile helloworld.hs at all (look in the Cabal file for details). This output shows that it’s working successfully.

So… hmm, not sure. I’ll have to think about this.
Oh, that makes sense. Thank you

Re: Brassica SCA [v1.0.0]

Posted: Sat Mar 15, 2025 5:44 pm
by Man in Space
Given the following:

new categories
V = a ã a̰ e ẽ ḛ i ĩ ḭ o õ o̰ u ũ ṵ ᵊ
© = a e i o u
Ñ = ã ẽ ĩ õ ũ
Ç = a̰ ḛ ḭ o̰ ṵ
Y = ѣ ь ъ
C = n b t k kʷ q qʷ ʔ s ɾ r l h
W = j w
end


the rule h / / V _ C refuses to work after —it seems not to want to recognize it as part of V (e.g., ihti comes out as iᵊhti and not iᵊti). Even changing this to h / / [V ᵊ] _ C explicitly doesn't work. Any idea what I'm doing wrong?

EDIT: Never mind, I figured it out.

Re: Brassica SCA [v1.0.0]

Posted: Wed Mar 19, 2025 3:01 am
by Lērisama
In happy news, I increased the size of the swap file and left it over night, and it compiled. I do have a question now though:

Is it possible to skip building the gui? I don't particularly feel like going through another few steps, and I don't particularly want it. I could probably find this out myself, but I thought I'd ask.

Re: Brassica SCA [v1.0.0]

Posted: Wed Mar 19, 2025 3:06 am
by bradrn
Lērisama wrote: Wed Mar 19, 2025 3:01 am In happy news, I increased the size of the swap file and left it over night, and it compiled.
Excellent!
Is it possible to skip building the gui? I don't particularly feel like going through another few steps, and I don't particularly want it. I could probably find this out myself, but I thought I'd ask.
Yes, Brassica is perfectly usable without a GUI. Just cabal install exe:brassica --installdir . --install-method=copy and you should have the CLI executable in the Brassica directory. No need to fiddle around with C++!

(In fact, by a curious coincidence I’m using the CLI right at this moment. If you already have a sound change file, it’s lovely to use together with Vim for editing words.)