Copperbox revision 3272.
I've deleted the modules Base.Impulse and Base.Behavior - they seem too "electro-acoustic" to be generally useful for Payasan (which aims for "song" generation and use with LMMS or similar). Plus I've added a Metronome module.
Monday, December 15, 2014
payasan
Copperbox revision 3271.
I've simplified the handling of pitch to two representations: a user level octave + scale degree representation and a low level MIDI note number one. I'm not going to attempt handling microtones in MIDI (technically possible with ingenious use of pitch bend) so I don't need anything more complex.
I've simplified the handling of pitch to two representations: a user level octave + scale degree representation and a low level MIDI note number one. I'm not going to attempt handling microtones in MIDI (technically possible with ingenious use of pitch bend) so I don't need anything more complex.
Sunday, December 14, 2014
payasan
Copperbox revision 3270.
I've ported all the useful code from Majalan to Payasan, and Payasan can now generate MIDI files from scores.
As MIDI is simpler than Csound (no chance of microtonality, no electro-acoustic instruments - i.e. processors) there is quite a lot of potential to simplify and improve the imported code.
I've ported all the useful code from Majalan to Payasan, and Payasan can now generate MIDI files from scores.
As MIDI is simpler than Csound (no chance of microtonality, no electro-acoustic instruments - i.e. processors) there is quite a lot of potential to simplify and improve the imported code.
Thursday, December 11, 2014
Monday, November 17, 2014
Sunday, November 16, 2014
Saturday, November 15, 2014
Friday, November 14, 2014
Thursday, November 13, 2014
Wednesday, November 12, 2014
Tuesday, November 11, 2014
Monday, November 10, 2014
Sunday, November 9, 2014
Thursday, November 6, 2014
Monday, October 27, 2014
Tuesday, October 21, 2014
Monday, October 20, 2014
oboe
Copperbox revision 3255.
Initial work on the parser and syntax for Oboe. The work is cribbed from Ochre, it always helps if you've written the code before...
Due to work commitments I still don't have much time for open source, but at least this month won't be a duck either.
Initial work on the parser and syntax for Oboe. The work is cribbed from Ochre, it always helps if you've written the code before...
Due to work commitments I still don't have much time for open source, but at least this month won't be a duck either.
Monday, September 29, 2014
oboe
Copperbox revision 3254.
I've started a new project Oboe to supersede Ochre. Oboe intends to be compositional through forms (as per the language Piccola) rather than traits.
The code so far is very tentative and is little more than a placeholder, but I'm desperate to make a commit to Copperbox this month. Due to work I've had almost no time for open-source, but I didn't want to mark the month with a "duck".
I've started a new project Oboe to supersede Ochre. Oboe intends to be compositional through forms (as per the language Piccola) rather than traits.
The code so far is very tentative and is little more than a placeholder, but I'm desperate to make a commit to Copperbox this month. Due to work I've had almost no time for open-source, but I didn't want to mark the month with a "duck".
Sunday, August 31, 2014
majalan
Copperbox revision 3253.
I've added a notelist module to base. Unlike the notelists in Majalan.Symbolic, this notelist is simply a list of bars containing notes or rests - it is not built within a monad.
The purpose of this notelist is to support developmental transformations - inversion, retrograde etc. None of these transformations has been implemented yet...
I've added a notelist module to base. Unlike the notelists in Majalan.Symbolic, this notelist is simply a list of bars containing notes or rests - it is not built within a monad.
The purpose of this notelist is to support developmental transformations - inversion, retrograde etc. None of these transformations has been implemented yet...
Friday, August 29, 2014
majalan
Copperbox revision 3252.
I've added a second pitch type - Centaur. This is Kraig Grady's 12-note scale.
Having an alternative pitch type to ET12, should hopefully help with coding "musically useful" transformations to Base.Melody - i.e. it should stop me thinking with an ET12 bias.
I've added a second pitch type - Centaur. This is Kraig Grady's 12-note scale.
Having an alternative pitch type to ET12, should hopefully help with coding "musically useful" transformations to Base.Melody - i.e. it should stop me thinking with an ET12 bias.
Thursday, August 28, 2014
majalan
Copperbox revision 3251.
I've moved the ET12 pitch modules into their own namespace and renamed the Base.PitchString module to Base.Melody.
Base.Melody now allows rests in the pitch string, my expectation is that this will let it represent more "musically useful" sequences without being burdened by note duration - all notes in a melody are unit length until they are transposed with a beat pattern or impulse map.
I've moved the ET12 pitch modules into their own namespace and renamed the Base.PitchString module to Base.Melody.
Base.Melody now allows rests in the pitch string, my expectation is that this will let it represent more "musically useful" sequences without being burdened by note duration - all notes in a melody are unit length until they are transposed with a beat pattern or impulse map.
Wednesday, August 27, 2014
majalan
Copperbox revision 3250.
Some simplification of beat and arpeggio patterns.
Beat patterns no longer contain rests - handling rests should be devolved to an object representing melody.
Arpeggio patterns are now a pair of the as-played notes and the pattern the arpeggiation follows.
Chain is now broken, but it was a bad abstraction anyway, so it will be replaced not fixed.
Some simplification of beat and arpeggio patterns.
Beat patterns no longer contain rests - handling rests should be devolved to an object representing melody.
Arpeggio patterns are now a pair of the as-played notes and the pattern the arpeggiation follows.
Chain is now broken, but it was a bad abstraction anyway, so it will be replaced not fixed.
Monday, August 25, 2014
majalan
Copperbox revision 3249.
I've simplified arpeggiator patterns, removing the introspective operations and the list-like ones. These removed operations would seem to make more sense operating on a general pitch string object, rather than an arpeggio which musically speaking is coupled to it's generating pitch set.
I've simplified arpeggiator patterns, removing the introspective operations and the list-like ones. These removed operations would seem to make more sense operating on a general pitch string object, rather than an arpeggio which musically speaking is coupled to it's generating pitch set.
Sunday, August 24, 2014
majalan
Copperbox revision 3248.
I've simplified ET12Chords, making it just functional rather than a weird monadic "command language".
It's disappointing that it has taken some reflection to realize the original design was so horrible (partial mitigation: I was trying to get a postfix notation without adding my own postfix application operator). It would be fair to expect that I've enough experience now to reject gawky, over-complicated code when I write it, rather than need a fortnight's hindsight to reveal it's problems.
I've simplified ET12Chords, making it just functional rather than a weird monadic "command language".
It's disappointing that it has taken some reflection to realize the original design was so horrible (partial mitigation: I was trying to get a postfix notation without adding my own postfix application operator). It would be fair to expect that I've enough experience now to reject gawky, over-complicated code when I write it, rather than need a fortnight's hindsight to reveal it's problems.
Thursday, August 21, 2014
majalan
Copperbox revision 3247.
I've simplified Arpa so arpeggios are basically just lists. There is one inelegance as the primitive combinators (up, down, asplayed) must always be seeded with the pitch set, even if they use the same same within an extended pattern. Otherwise, though, the new version looks like a fair improvement.
Side note - work on Majalan has slowed down, I've started to work with C# as my professional skillset needs enhancing.
I've simplified Arpa so arpeggios are basically just lists. There is one inelegance as the primitive combinators (up, down, asplayed) must always be seeded with the pitch set, even if they use the same same within an extended pattern. Otherwise, though, the new version looks like a fair improvement.
Side note - work on Majalan has slowed down, I've started to work with C# as my professional skillset needs enhancing.
Saturday, August 16, 2014
majalan
Copperbox revision 3246.
Minor work on Chain rephrasing the troublesome bar parsers. However, Chain (vis parsing) now looks like the wrong abstraction - it just doesn't seem to be a musical abstraction. A rethink is needed.
As a side note, I've missed the essence of TikZ's chains in both Wumpus and currently Majalan. Chains aren't about consumption - stepping through a trail or parsing a beat pattern. They are a way of making a trial not following one.
Minor work on Chain rephrasing the troublesome bar parsers. However, Chain (vis parsing) now looks like the wrong abstraction - it just doesn't seem to be a musical abstraction. A rethink is needed.
As a side note, I've missed the essence of TikZ's chains in both Wumpus and currently Majalan. Chains aren't about consumption - stepping through a trail or parsing a beat pattern. They are a way of making a trial not following one.
Friday, August 15, 2014
majalan
Copperbox revision 3244.
I've been reworking Chain so it is based on parsing rather than stepping. The current version is very prototypical - there are enough differences to classic parser combinators (e.g. Parsec) that I can't crib Parsec's API wholesale.
I've been reworking Chain so it is based on parsing rather than stepping. The current version is very prototypical - there are enough differences to classic parser combinators (e.g. Parsec) that I can't crib Parsec's API wholesale.
Wednesday, August 13, 2014
majalan
Copperbox revision 3243.
I've moved the Bar and GenDivision datatypes from Base.BeatPattern into Base.Internal.Beat.
This is prelude to reworking Chain to consume bars rather than impulses. Impulses don't seem to have enough information to step through as a Chain - we can't do anything musically useful with the impulses other than transpose them. Stepping through bars appears to have more potential as we have an idea of the metrical structure.
I've moved the Bar and GenDivision datatypes from Base.BeatPattern into Base.Internal.Beat.
This is prelude to reworking Chain to consume bars rather than impulses. Impulses don't seem to have enough information to step through as a Chain - we can't do anything musically useful with the impulses other than transpose them. Stepping through bars appears to have more potential as we have an idea of the metrical structure.
Tuesday, August 12, 2014
majalan
Copperbox revision 3239.
I've wrapped Score into a data structure ScoreObj so clients have a better API - previously building Scores and and rendering them to text were mixed together, now they are separate.
The trick I've used for this will likely be useful in improving Majalan's API in other places as well.
I've wrapped Score into a data structure ScoreObj so clients have a better API - previously building Scores and and rendering them to text were mixed together, now they are separate.
The trick I've used for this will likely be useful in improving Majalan's API in other places as well.
Monday, August 11, 2014
majalan
Copperbox revision 3236.
Some tidying up.
I've started to work on a longer example (nothing substantial to commit to Copperbox yet) as a means to evaluate whether the abstractions in Majalan.Base are useful, expressive, etc. This round of tidying up is the first action resulting from working on the longer example. Another problem it has identified is that impulses add too much clutter - having just one notelist like object generating impulses is probably sufficient.
Some tidying up.
I've started to work on a longer example (nothing substantial to commit to Copperbox yet) as a means to evaluate whether the abstractions in Majalan.Base are useful, expressive, etc. This round of tidying up is the first action resulting from working on the longer example. Another problem it has identified is that impulses add too much clutter - having just one notelist like object generating impulses is probably sufficient.
majalan
Copperbox revision 3235.
Initial work on supporting FRP style behaviors which should allow time varying articulation.
The code has been cribbed directly from a previous version of Majalan where it wasn't really worked out - it is possible that it just won't work well for the current Majalan.
Initial work on supporting FRP style behaviors which should allow time varying articulation.
The code has been cribbed directly from a previous version of Majalan where it wasn't really worked out - it is possible that it just won't work well for the current Majalan.
Sunday, August 10, 2014
majalan
Copperbox revision 3234.
I've changed the internal representation of Trail so that the accumulation is built as per writer (rather than passed around as state). Although this is less efficient, it allows a remapping operation that can change the type of the trail's impulses.
I've changed the internal representation of Trail so that the accumulation is built as per writer (rather than passed around as state). Although this is less efficient, it allows a remapping operation that can change the type of the trail's impulses.
majalan
Copperbox revision 3233.
I've added some combinators to build Trails. Plus I've made a distinct type for fixed-width events - this seems the right thing to do, but it obliges me to think more carefully about the APIs for trill etc. Currently the code is messier for introducing fixed-width events rather than improved.
I've added some combinators to build Trails. Plus I've made a distinct type for fixed-width events - this seems the right thing to do, but it obliges me to think more carefully about the APIs for trill etc. Currently the code is messier for introducing fixed-width events rather than improved.
Saturday, August 9, 2014
majalan
Copperbox revision 3232.
I've reworked ImpulseMap, removing the InterimIM datatype.
I've added a module Trail for building proto ImpulseMaps, but Trail has monadic type so it can't fully replace InterimIM. Next I'll have to code some combinators that justify the introduction of Trial - for instance Trail should be building block for trills and tremolos (and should allow accelerating and decelerating onsets of trill notes).
I've reworked ImpulseMap, removing the InterimIM datatype.
I've added a module Trail for building proto ImpulseMaps, but Trail has monadic type so it can't fully replace InterimIM. Next I'll have to code some combinators that justify the introduction of Trial - for instance Trail should be building block for trills and tremolos (and should allow accelerating and decelerating onsets of trill notes).
Thursday, August 7, 2014
Wednesday, August 6, 2014
majalan
Copperbox revision 3230.
I've removed the width answer from the Event datatype (and EventAns).
Having Event return width was patterned after characters in PostScript having implicit advance / width vectors; but in music Events are always specified with their duration (width) at the call site, so returning width again was not meaningful.
I've removed the width answer from the Event datatype (and EventAns).
Having Event return width was patterned after characters in PostScript having implicit advance / width vectors; but in music Events are always specified with their duration (width) at the call site, so returning width again was not meaningful.
Tuesday, August 5, 2014
majalan
Copperbox revision 3229.
I've split EventList out from the Event module and put it into its own module.
Also, I've had the first proper look at fixed duration events. Some instruments, like gongs, have sounding times that are much longer than notes played on them and others have sounding times much shorter than the note played on them e.g. a hi-hat. In both cases the duration of event is independent of the length of the note being played (from the score). I had partially thought about this the Advance module but the rightful place should be Event.
I've split EventList out from the Event module and put it into its own module.
Also, I've had the first proper look at fixed duration events. Some instruments, like gongs, have sounding times that are much longer than notes played on them and others have sounding times much shorter than the note played on them e.g. a hi-hat. In both cases the duration of event is independent of the length of the note being played (from the score). I had partially thought about this the Advance module but the rightful place should be Event.
Monday, August 4, 2014
majalan
Copperbox revision 3228.
I've changed the representation of Event to allow multiple Csound events per an Event (previously an Event generated exactly one Csound event). This allows music objects like trills and chords to be treated as atomic events rather than event lists.
I've changed the representation of Event to allow multiple Csound events per an Event (previously an Event generated exactly one Csound event). This allows music objects like trills and chords to be treated as atomic events rather than event lists.
Sunday, August 3, 2014
majalan
Copperbox revision 3227.
I've added a mini-DSL for creating chords. This DSL is monadic; the previous version of Majalan had a version that used just function composition. There isn't a great difference between them, but it seems consistent with the current Majalan to favor monads.
I've added a mini-DSL for creating chords. This DSL is monadic; the previous version of Majalan had a version that used just function composition. There isn't a great difference between them, but it seems consistent with the current Majalan to favor monads.
Saturday, August 2, 2014
Friday, August 1, 2014
majalan
Copperbox revision 3224.
I've improved the Score API - EventLists now get metrical information from the point they are queued (following meter / tempo changes in the score) and I've made the placement combinator `at` symbolic - placement is musical position (bar and beat number). There is a new combinator `onset` that uses absolute time for placement apropos the previous behavior of `at`.
I've improved the Score API - EventLists now get metrical information from the point they are queued (following meter / tempo changes in the score) and I've made the placement combinator `at` symbolic - placement is musical position (bar and beat number). There is a new combinator `onset` that uses absolute time for placement apropos the previous behavior of `at`.
Thursday, July 31, 2014
majalan
Copperbox revision 3222.
I've made Part a concrete object, this is so it can be decomposed into multiple event lists, e.g. one for intro, one for chorus, etc.
Parts are expected to be played by one instrument or player e.g. a drum part might have multiple instruments, but often a part will have just one instrument e.g. a bass line.
I've made Part a concrete object, this is so it can be decomposed into multiple event lists, e.g. one for intro, one for chorus, etc.
Parts are expected to be played by one instrument or player e.g. a drum part might have multiple instruments, but often a part will have just one instrument e.g. a bass line.
Wednesday, July 30, 2014
Tuesday, July 29, 2014
Monday, July 28, 2014
majalan
Copperbox revision 3216.
I've improved the algorithm that builds an ImpulseMap from a Timeline. I've also removed the duplication of User context in the Advance object.
These improvements are a prelude to adding Chains - an abstraction Wumpus had for stepping through point sequences. Chains in Majalan will step through Impulse Maps.
I've improved the algorithm that builds an ImpulseMap from a Timeline. I've also removed the duplication of User context in the Advance object.
These improvements are a prelude to adding Chains - an abstraction Wumpus had for stepping through point sequences. Chains in Majalan will step through Impulse Maps.
Sunday, July 27, 2014
Saturday, July 26, 2014
Friday, July 25, 2014
majalan
Copperbox revision 3213.
I've back out the changes that added Timeline to Context. I now feel only Score should have access to Timeline.
Once I add Timeline to Score, I can implement a placement API for parts that uses symbolic positions (bar and beat number) rather than absolute onset times. Putting tempo and time signature back into event lists simplifies them and better allows for polyrhythms. Inheriting tempo and time signature from a global immutable timeline restricted polyrhythmic parts.
I've back out the changes that added Timeline to Context. I now feel only Score should have access to Timeline.
Once I add Timeline to Score, I can implement a placement API for parts that uses symbolic positions (bar and beat number) rather than absolute onset times. Putting tempo and time signature back into event lists simplifies them and better allows for polyrhythms. Inheriting tempo and time signature from a global immutable timeline restricted polyrhythmic parts.
Thursday, July 24, 2014
Wednesday, July 23, 2014
Tuesday, July 22, 2014
majalan
Copperbox revision 3210.
I've added Timeline into the Context which is threaded through all the monads (Advance, EventList, Score..).
Because the global timeline allows tempo and time signature changes, Context no longer supports a simple API to get quarter_note_length (quarter_note_length is now dependent on position in the score). Thus, the note lists used by Demo02 and Demo03 are broken again, pending a rethink.
I've added Timeline into the Context which is threaded through all the monads (Advance, EventList, Score..).
Because the global timeline allows tempo and time signature changes, Context no longer supports a simple API to get quarter_note_length (quarter_note_length is now dependent on position in the score). Thus, the note lists used by Demo02 and Demo03 are broken again, pending a rethink.
majalan
Copperbox revision 3209.
Work towards a global metrical timeline. Both Ableton Live and Garage Band have metrical time lines - graphically it seems a good abstraction for synchronizing tracks.
If I add it properly to Majalan (currently it is just a standalone module under test) I'll have to remove BPM from the Context. BPM will still be accessible to individual event lists but it will be read-only and derived from the global timeline.
Work towards a global metrical timeline. Both Ableton Live and Garage Band have metrical time lines - graphically it seems a good abstraction for synchronizing tracks.
If I add it properly to Majalan (currently it is just a standalone module under test) I'll have to remove BPM from the Context. BPM will still be accessible to individual event lists but it will be read-only and derived from the global timeline.
Monday, July 21, 2014
majalan
Copperbox revision 3207.
I've changed Context to allow user context and removed tuning pitch and amplitude which were mostly superfluous (and added complexity).
For the moment, I've removed Advance's dependency on Context. This simplifies Advance and its current API doesn't need it, but it might be the wrong decision (as a comparison Wumpus threaded Context through everything but then Context was much more important).
As I'm undecided about objects depending on Context, both note lists and thus Demo02 and Demo03 are all currently broken.
I've changed Context to allow user context and removed tuning pitch and amplitude which were mostly superfluous (and added complexity).
For the moment, I've removed Advance's dependency on Context. This simplifies Advance and its current API doesn't need it, but it might be the wrong decision (as a comparison Wumpus threaded Context through everything but then Context was much more important).
As I'm undecided about objects depending on Context, both note lists and thus Demo02 and Demo03 are all currently broken.
majalan
Copperbox revisions 3205 & 3206.
Minor refactoring.
I've changed the name of Majalan.Base.NoteList to Majalan.Base.Advance so that it doesn't steal a name that is better used for a notelist. Majalan.Base.Advance provides some of the primitives to build custom notelists.
I've also split Processor out from Event.
Minor refactoring.
I've changed the name of Majalan.Base.NoteList to Majalan.Base.Advance so that it doesn't steal a name that is better used for a notelist. Majalan.Base.Advance provides some of the primitives to build custom notelists.
I've also split Processor out from Event.
Sunday, July 20, 2014
bala - package cull
Copperbox revision 3202.
I've culled a number of redundant packages from the bala top level directory:
bala/HNotate
bala/M2
bala/Neume
bala/Variant
bala/ZMidi
bala/ZWav
bala/bala-core
bala/fmss
bala/haddock
bala/jerry-osc
bala/jerry-supercollider
bala/micro-ochre
bala/monad-redux
bala/neume-core
bala/neume-extra
bala/new-neume
bala/orca-ix
bala/orchsyn
bala/pdss-core
bala/slac
bala/tactus
bala/tonos
bala/zsnd-basic
bala/zsnd-core
bala/zsnd-symbolic
bala/zsyn
Some of the remaining packages are also redundant, but for the moment their source can stay in Copperbox.
I've culled a number of redundant packages from the bala top level directory:
bala/HNotate
bala/M2
bala/Neume
bala/Variant
bala/ZMidi
bala/ZWav
bala/bala-core
bala/fmss
bala/haddock
bala/jerry-osc
bala/jerry-supercollider
bala/micro-ochre
bala/monad-redux
bala/neume-core
bala/neume-extra
bala/new-neume
bala/orca-ix
bala/orchsyn
bala/pdss-core
bala/slac
bala/tactus
bala/tonos
bala/zsnd-basic
bala/zsnd-core
bala/zsnd-symbolic
bala/zsyn
Some of the remaining packages are also redundant, but for the moment their source can stay in Copperbox.
Saturday, July 19, 2014
ochre-lang
Copperbox revision 3199.
I've "finished" the implement of local functions, although I suspect it my harbor bugs due to alpha renaming. The trivial test case works, but that isn't saying much.
I've "finished" the implement of local functions, although I suspect it my harbor bugs due to alpha renaming. The trivial test case works, but that isn't saying much.
Friday, July 18, 2014
ochre-lang
Copperbox revision 3198.
Work towards adding local function definitions - approximately lambdas but they must be named.
The implementation is only partially complete as it has been a lot more work than I expected as most of the machinery was in place already (it's almost same as super-call inlining).
Work towards adding local function definitions - approximately lambdas but they must be named.
The implementation is only partially complete as it has been a lot more work than I expected as most of the machinery was in place already (it's almost same as super-call inlining).
Wednesday, July 16, 2014
ochre-lang
Copperbox revision 3197.
I've fixed a long standing bug in trait flattening where trait composition was not finding the "combined difference" of two traits instead it was only finding the difference of the left trait (as per the difference operator on Haskell's Data.Map).
Also, I've made the compiler write to file as the final step rather than write to debug. Implementing this makes Ochre seem like a real compiler.
I've fixed a long standing bug in trait flattening where trait composition was not finding the "combined difference" of two traits instead it was only finding the difference of the left trait (as per the difference operator on Haskell's Data.Map).
Also, I've made the compiler write to file as the final step rather than write to debug. Implementing this makes Ochre seem like a real compiler.
Tuesday, July 15, 2014
ochre-lang
Copperbox revision 3196.
I've rewritten the Compile module so that the main compilation function compileProgram is in a more step-by-step form. This has allowed me to add debug output for every step.
I've rewritten the Compile module so that the main compilation function compileProgram is in a more step-by-step form. This has allowed me to add debug output for every step.
ochre-lang
Copperbox revision 3195.
Work towards simplify the compile steps. Ideally the function compileProgram in the Compile module should read as step-by-step instructions showing the compiler works.
Work towards simplify the compile steps. Ideally the function compileProgram in the Compile module should read as step-by-step instructions showing the compiler works.
Monday, July 14, 2014
ochre-lang
Copperbox revision 3193.
Initial work adding compiler debug output in the style of GHC's -ddump-pass. I expect this will supersede the Reporting module at some point.
Initial work adding compiler debug output in the style of GHC's -ddump-pass. I expect this will supersede the Reporting module at some point.
ochre-lang
Copperbox revision 3191.
I've added IO to the Compiler monad. This means module loading can be done in the Compiler monad rather than the OchreIO monad in ModuleIO. This should lead to simplifications in the ModuleIO and Compile modules as the OchreIO monad can be removed.
Update - Copperbox revision 3192.
ModuleIO now uses the Compiler monad.
I've added IO to the Compiler monad. This means module loading can be done in the Compiler monad rather than the OchreIO monad in ModuleIO. This should lead to simplifications in the ModuleIO and Compile modules as the OchreIO monad can be removed.
Update - Copperbox revision 3192.
ModuleIO now uses the Compiler monad.
Sunday, July 13, 2014
ochre-lang
Copperbox revision 3190.
I've added a checker for unbound variables and unrecognized prim-ids just before the final transltion to Csound. At this point all free variables should have been bound by the introduction of init declarations and unrecognized opcodes are either typing mistakes or method calls with missing definitions (and hence haven't been inlined).
I've added a checker for unbound variables and unrecognized prim-ids just before the final transltion to Csound. At this point all free variables should have been bound by the introduction of init declarations and unrecognized opcodes are either typing mistakes or method calls with missing definitions (and hence haven't been inlined).
Saturday, July 12, 2014
ochre-lang
Copperbox revision 3189.
I've fixed mistakes in the ExpandMain and InlineSuper modules, stopping them re-initialize the fresh variable counter. This was re-generating already used names in an expression. Also I've improved let-linearization which was stopping demo 4 (which uses super calls) working.
That said, I'm not entirely convinced I'm inlining super calls correctly - I have a feeling they should be inlining in concert with inheritance flattening.
I've fixed mistakes in the ExpandMain and InlineSuper modules, stopping them re-initialize the fresh variable counter. This was re-generating already used names in an expression. Also I've improved let-linearization which was stopping demo 4 (which uses super calls) working.
That said, I'm not entirely convinced I'm inlining super calls correctly - I have a feeling they should be inlining in concert with inheritance flattening.
Friday, July 11, 2014
ochre-lang
Copperbox revision 3188.
I've changed all the modules that used throwError from the Compiler monad module to use Reporting functionality instead.
I've changed all the modules that used throwError from the Compiler monad module to use Reporting functionality instead.
Thursday, July 10, 2014
ochre-lang
Copperbox revision 3187.
I've changed Reporting to use a Parsec-Token style module. I'm not sure this is really warranted but it should be easily extensible if the need arises.
Also I've changed FlattenTraits to run in the Compiler monad. Previously it had been throwing a system error rather than use the error reporting in Compiler monad.
I've changed Reporting to use a Parsec-Token style module. I'm not sure this is really warranted but it should be easily extensible if the need arises.
Also I've changed FlattenTraits to run in the Compiler monad. Previously it had been throwing a system error rather than use the error reporting in Compiler monad.
Wednesday, July 9, 2014
ochre-lang
Copperbox revision 3186.
Initial work adding the infrastructure for better (read longer, more verbose...) error reporting and logging.
Initial work adding the infrastructure for better (read longer, more verbose...) error reporting and logging.
Tuesday, July 8, 2014
ochre-lang
Copperbox revision 3185.
I've added a demo that tests the module system.
At the moment it doesn't compile but already it has identified a bug in normalizing traits (fixed) and reinforced that I should make improving error messages a priority.
I've added a demo that tests the module system.
At the moment it doesn't compile but already it has identified a bug in normalizing traits (fixed) and reinforced that I should make improving error messages a priority.
Monday, July 7, 2014
ochre-lang
Copperbox revision 3184.
I've added a Main module so Ochre can be run from the command line.
I've added a Main module so Ochre can be run from the command line.
Friday, July 4, 2014
ochre-lang
Copperbox revision 3183.
I've implemented modules and import chasing (so far untested).
This means that all the major pieces of the compiler are now in place, even if some bits are untested and one of the current tests shows some bits don't work.
I've implemented modules and import chasing (so far untested).
This means that all the major pieces of the compiler are now in place, even if some bits are untested and one of the current tests shows some bits don't work.
ochre-lang
Copperbox revision 3182.
Initial work implementing modules in the parser and top-level syntax.
Although some placeholder code has been in for modules for quite a while, all the real work was outstanding. I've now changed the parser so it will parse the Main module with an Orchestra spec and library modules without one.
Getting the compiler to chase imports needs implementing.
Initial work implementing modules in the parser and top-level syntax.
Although some placeholder code has been in for modules for quite a while, all the real work was outstanding. I've now changed the parser so it will parse the Main module with an Orchestra spec and library modules without one.
Getting the compiler to chase imports needs implementing.
Thursday, July 3, 2014
ochre-lang
Copperbox revision 3181.
I've fixed a bug in ToplevelTrans where it was throwing an error if free variables were encountered in expressions (and hence method bodies). We want free variables here as we can now bind them at orchestra definition time (late binding).
I've also fixed a bug in the parser where it didn't recognize Pfields in InitDecls. Pfields are forbidden in method bodies because they are anti-modular (i.e. positional rather than named).
I've fixed a bug in ToplevelTrans where it was throwing an error if free variables were encountered in expressions (and hence method bodies). We want free variables here as we can now bind them at orchestra definition time (late binding).
I've also fixed a bug in the parser where it didn't recognize Pfields in InitDecls. Pfields are forbidden in method bodies because they are anti-modular (i.e. positional rather than named).
ochre-lang
Copperbox revision 3180.
I've fixed the problems I alluded to in the last message - Instruments in the intermediate representation no longer have instrument_number so they don't have to be assigned an initial, unresolved (-1).
Also, I've implemented init-decls from the Orchestra spec which should late bind free variables in an instrument. This is supposed to be Ochre-lang's innovative feature, unfortunately it isn't working yet. I'll have to re-introduce something to debug-print the compiler steps so I can find out what is going wrong.
I've fixed the problems I alluded to in the last message - Instruments in the intermediate representation no longer have instrument_number so they don't have to be assigned an initial, unresolved (-1).
Also, I've implemented init-decls from the Orchestra spec which should late bind free variables in an instrument. This is supposed to be Ochre-lang's innovative feature, unfortunately it isn't working yet. I'll have to re-introduce something to debug-print the compiler steps so I can find out what is going wrong.
ochre-lang
Copperbox revision 3179.
I've finally worked on the super-call inlining code. At the moment it doesn't quite work as there are a couple of standout bugs, fixing them suggests some rethinking, so I'm committing the "code so far".
I also have a more over-arching worry that super-inlining and inheritance flattening should be done at the same time, but investigating this will have to wait.
I've finally worked on the super-call inlining code. At the moment it doesn't quite work as there are a couple of standout bugs, fixing them suggests some rethinking, so I'm committing the "code so far".
I also have a more over-arching worry that super-inlining and inheritance flattening should be done at the same time, but investigating this will have to wait.
Wednesday, July 2, 2014
ochre-lang
Copperbox revision 3178.
I've simplified identifiers - now there are just two: Ident and VarId. PrimId has been removed. I've also added if-then-else blocks to the do syntax.
Things are now sufficiently tidy, so next I'll finally try to tackle super-inlining.
I've simplified identifiers - now there are just two: Ident and VarId. PrimId has been removed. I've also added if-then-else blocks to the do syntax.
Things are now sufficiently tidy, so next I'll finally try to tackle super-inlining.
ochre-lang
Copperbox revision 3176.
I've added initialization expressions to the orchestra syntax - these will allow i-rate variables to be defined and p-fields to be accessed.
P-fields are positional so they are not modular - if a trait tried to use a p-field, it wouldn't know what the p-field pointed to until final composition. Semantically this is wrong - traits should reference named (free-) variables which are closed when the final orchestra is defined, initialization expressions in the orchestra definition allow this.
At the moment initialization expressions have only been added to the front-end, they need adding to the back-end just before final translation to Csound.
Edit - Copperbox revision 3177.
I've added the file InitialExpr.hs that was missing in the last commit, plus some work on the pretty printer.
I've added initialization expressions to the orchestra syntax - these will allow i-rate variables to be defined and p-fields to be accessed.
P-fields are positional so they are not modular - if a trait tried to use a p-field, it wouldn't know what the p-field pointed to until final composition. Semantically this is wrong - traits should reference named (free-) variables which are closed when the final orchestra is defined, initialization expressions in the orchestra definition allow this.
At the moment initialization expressions have only been added to the front-end, they need adding to the back-end just before final translation to Csound.
Edit - Copperbox revision 3177.
I've added the file InitialExpr.hs that was missing in the last commit, plus some work on the pretty printer.
Tuesday, July 1, 2014
ochre-lang
Copperbox revision 3175.
More preliminary work before I implement inlining for super-calls.
I've had to take modules a bit more seriously. I was going to leave them until after I'd implemented super inlining, but the simple scheme I had where the intermediate layer only considered instruments demanded by the orchestra spec isn't going to work. Because the super calls of an instrument might resolve to an instrument not in the orchestra spec all instruments in a module need translating upto super-inlining.
More preliminary work before I implement inlining for super-calls.
I've had to take modules a bit more seriously. I was going to leave them until after I'd implemented super inlining, but the simple scheme I had where the intermediate layer only considered instruments demanded by the orchestra spec isn't going to work. Because the super calls of an instrument might resolve to an instrument not in the orchestra spec all instruments in a module need translating upto super-inlining.
ochre-lang
Copperbox revision 3174.
More preliminary work prior to implementing super-call inlining.
I've added a SuperCall constructor to the Expr data type in the intermediate syntax. Because I'll need alpha renaming, super-call inlining will have to work on the intermediate syntax.
More preliminary work prior to implementing super-call inlining.
I've added a SuperCall constructor to the Expr data type in the intermediate syntax. Because I'll need alpha renaming, super-call inlining will have to work on the intermediate syntax.
ochre-lang
Copperbox revision 3173.
Some minor tidying before I implement super-class method calls.
Calls to super will be inlined, so it looks like they'll have to be resolved on the intermediate syntax where we have alpha renaming. I've added the field instr_superclass to Instrument in expectation of this.
Some minor tidying before I implement super-class method calls.
Calls to super will be inlined, so it looks like they'll have to be resolved on the intermediate syntax where we have alpha renaming. I've added the field instr_superclass to Instrument in expectation of this.
Monday, June 30, 2014
ochre-lang
Copperbox revision 3172.
I've implemented a simplistic form of inheritance - super-class methods get inherited, but a local redefinition in the class overrides the super-class method completely . There is no super at the moment to invoke the method in the parent class.
I've implemented a simplistic form of inheritance - super-class methods get inherited, but a local redefinition in the class overrides the super-class method completely . There is no super at the moment to invoke the method in the parent class.
ochre-lang
Copperbox revision 3171.
I've added super-class inheritance to the top-level syntax and the parser. Implementing inheritance is todo...
I've added super-class inheritance to the top-level syntax and the parser. Implementing inheritance is todo...
ochre-lang
Copperbox revision 3170.
I've implemented a preliminary version of tuple elimination. Currently nested tuples will break the compiler, but otherwise I'm pleased with the implementation. Temporary variables introduced to deconstruct a tuple are removed later by the ElimLet optimization.
I've implemented a preliminary version of tuple elimination. Currently nested tuples will break the compiler, but otherwise I'm pleased with the implementation. Temporary variables introduced to deconstruct a tuple are removed later by the ElimLet optimization.
Sunday, June 29, 2014
ochre-lang
Copperbox revision 3169.
I've added LetTuple to the Expr type in the intermediate syntax.
If I have a LetTuple form in the syntax, I should be able to eliminate Tuples with an Expr -> Expr compiler pass. Before doing the actual work, this seems easier than trying to eliminate tuples as part of the translation from top-level syntax.
I've added LetTuple to the Expr type in the intermediate syntax.
If I have a LetTuple form in the syntax, I should be able to eliminate Tuples with an Expr -> Expr compiler pass. Before doing the actual work, this seems easier than trying to eliminate tuples as part of the translation from top-level syntax.
ochre-lang
Copperbox revision 3168.
Work on generalizing the "run compiler" code so I can just run particular steps and dump their output for checking.
Note - the pretty printer for the intermediate representation needs changing as it uses a syntax from the original Ochre; instead it should look like Ochre-lang's top-level syntax as much as possible.
Work on generalizing the "run compiler" code so I can just run particular steps and dump their output for checking.
Note - the pretty printer for the intermediate representation needs changing as it uses a syntax from the original Ochre; instead it should look like Ochre-lang's top-level syntax as much as possible.
Saturday, June 28, 2014
ochre-lang
Copperbox revision 3167.
I've removed Signal from the Value type in the intermediate syntax and added Tuple. Signal was a left over from when Ochre was embedded in Haskell. I've added Tuple even though tuples will need eliminating before the final translation to Csound. I believe I've devised an elimination scheme that will work if tuples are in the tail position - this will be easiest to do as a rewrite pass on the intermediate syntax (hence it needs tuples).
I've removed Signal from the Value type in the intermediate syntax and added Tuple. Signal was a left over from when Ochre was embedded in Haskell. I've added Tuple even though tuples will need eliminating before the final translation to Csound. I believe I've devised an elimination scheme that will work if tuples are in the tail position - this will be easiest to do as a rewrite pass on the intermediate syntax (hence it needs tuples).
Friday, June 27, 2014
ochre-lang
Copperbox revision 3166.
More work on supporting tuples, binding multiple return opcodes (e.g. ins, pan) is now possible.
However, my thinking has moved on since yesterday - I now think tuples should be first class, whereas yesterday I thought they would only be needed for destructuring at opcode binding sites (ins, pan again). If tuples aren't first class we can't write methods that return tuples, this is a too severe restriction as it limits modularity.
Because Csound doesn't have tuples, I will need to think carefully about how to implement them - they must be eliminated in translation.
More work on supporting tuples, binding multiple return opcodes (e.g. ins, pan) is now possible.
However, my thinking has moved on since yesterday - I now think tuples should be first class, whereas yesterday I thought they would only be needed for destructuring at opcode binding sites (ins, pan again). If tuples aren't first class we can't write methods that return tuples, this is a too severe restriction as it limits modularity.
Because Csound doesn't have tuples, I will need to think carefully about how to implement them - they must be eliminated in translation.
Thursday, June 26, 2014
ochre-lang
Copperbox revision 3165.
I've added lists to the type syntax - this allows opcodes with variable length argument lists to be encoded as builtins. I haven't yet encoded lists in the expression syntax.
Note - both lists and tuples will not be first class in Ochre-lang. Tuples will only support deconstruction (pattern matching) and lists will only support construction in opcode application.
I've added lists to the type syntax - this allows opcodes with variable length argument lists to be encoded as builtins. I haven't yet encoded lists in the expression syntax.
Note - both lists and tuples will not be first class in Ochre-lang. Tuples will only support deconstruction (pattern matching) and lists will only support construction in opcode application.
Wednesday, June 25, 2014
ochre-lang
Copperbox revision 3164.
I've changed the concrete syntax of opcode and function calls to be more like Csound and less like Haskell - params in opcode calls are comma separated, params in function calls are in parens and comma separated. This resolves a bug in the parser.
I've changed the concrete syntax of opcode and function calls to be more like Csound and less like Haskell - params in opcode calls are comma separated, params in function calls are in parens and comma separated. This resolves a bug in the parser.
Tuesday, June 24, 2014
ochre-lang
Copperbox revision 3163.
I've hooked up the optimization passes[*] and the final Csound code generator and the simple example now compiles to a working Csound orchestra. This is a success...
[*] As Ochre-lang has changed from being a (sort of) functional language to an OO one I'm not sure the optimization passes are relevant anymore - mostly they optimize forms which are no longer present in the intermediate code.
I've hooked up the optimization passes[*] and the final Csound code generator and the simple example now compiles to a working Csound orchestra. This is a success...
[*] As Ochre-lang has changed from being a (sort of) functional language to an OO one I'm not sure the optimization passes are relevant anymore - mostly they optimize forms which are no longer present in the intermediate code.
Monday, June 23, 2014
ochre-lang
Copperbox revision 3162.
I've now implemented the translation from top-level syntax to the intermediate syntax.
Although I've done some tidying up, there is still quite a lot of cruft in the intermediate syntax code brought over from the original Ochre. Thus, the intermediate syntax will need more cleaning up as I connect the optimization passes back in.
I've now implemented the translation from top-level syntax to the intermediate syntax.
Although I've done some tidying up, there is still quite a lot of cruft in the intermediate syntax code brought over from the original Ochre. Thus, the intermediate syntax will need more cleaning up as I connect the optimization passes back in.
ochre-lang
Copperbox revision 3161.
I've done most of the work on the translation from top-level syntax to the intermediate syntax. Unfortunately the intermediate syntax has quite a bit of cruft (inherited from the original Ochre) so I'll have to deal with that before I can finish the translation.
I've made a commit now because I don't want the changes to the intermediate syntax to form an overwhelming changeset.
I've done most of the work on the translation from top-level syntax to the intermediate syntax. Unfortunately the intermediate syntax has quite a bit of cruft (inherited from the original Ochre) so I'll have to deal with that before I can finish the translation.
I've made a commit now because I don't want the changes to the intermediate syntax to form an overwhelming changeset.
Sunday, June 22, 2014
ochre-lang
Copperbox revision 3160.
I've removed some redundant parts of the top-level syntax - let, lambda and embedded do in the Expr datatype. These forms were inherited from the original Ochre and aren't needed.
Simplifying this syntax is a diversion from inline expansion - it looks like inline expansion will be easier to perform on the intermediate syntax (where alpha renaming is available) so I'll have to translate from the top-level syntax before I complete the implementation of inline expansion.
I've removed some redundant parts of the top-level syntax - let, lambda and embedded do in the Expr datatype. These forms were inherited from the original Ochre and aren't needed.
Simplifying this syntax is a diversion from inline expansion - it looks like inline expansion will be easier to perform on the intermediate syntax (where alpha renaming is available) so I'll have to translate from the top-level syntax before I complete the implementation of inline expansion.
ochre-lang
Copperbox revision 3159.
Initial work inline expanding main so that Instrs have a single method. There is no procedural abstraction in Csound orchestras so we have to eliminate methods in Ochre by inlining them into a single main function.
Initial work inline expanding main so that Instrs have a single method. There is no procedural abstraction in Csound orchestras so we have to eliminate methods in Ochre by inlining them into a single main function.
Saturday, June 21, 2014
ochre-lang
Copperbox revision 3157.
I've added syntax for types so that I can define a list of Csound builtins.
I'm not sure otherwise if Ochre will get a type system - I may just implement arity checking of functions. A type system would be nice of course, but there are a lot of other things to implement first.
I've added syntax for types so that I can define a list of Csound builtins.
I'm not sure otherwise if Ochre will get a type system - I may just implement arity checking of functions. A type system would be nice of course, but there are a lot of other things to implement first.
ochre-lang
Copperbox revision 3156.
I've implemented a simple version of trait flattening (essentially cribbed from the Flattening Traits paper - Nierstrasz, Ducasse and Scharli).
I'll need to put it in the Compiler monad so it can log conflicts etc. and I'll have to add cycle detection for trait definitions, but at the moment it seems to work for my small example.
I've implemented a simple version of trait flattening (essentially cribbed from the Flattening Traits paper - Nierstrasz, Ducasse and Scharli).
I'll need to put it in the Compiler monad so it can log conflicts etc. and I'll have to add cycle detection for trait definitions, but at the moment it seems to work for my small example.
Friday, June 20, 2014
ochre-lang
Copperbox revision 3155.
Work towards flattening and inlining traits. I've changed the syntax so method declarations have a list of arguments (methods must always be fully specified - there is no currying) and added logging warnings to the Compiler monad. I've done some work on the flattening traits but even though I've read the trait papers from SCG Bern I'm not sure of a good way to do it for Ochre.
Work towards flattening and inlining traits. I've changed the syntax so method declarations have a list of arguments (methods must always be fully specified - there is no currying) and added logging warnings to the Compiler monad. I've done some work on the flattening traits but even though I've read the trait papers from SCG Bern I'm not sure of a good way to do it for Ochre.
Tuesday, June 17, 2014
ochre-lang
Copperbox revision 3154.
I've added traits (c.f Pharo Smalltalk) to the top-level syntax. My expectation is that traits will allow instruments to be defined from modular parts.
At the moment there is no flattening of traits - all the processing after parsing needs implementing...
I've added traits (c.f Pharo Smalltalk) to the top-level syntax. My expectation is that traits will allow instruments to be defined from modular parts.
At the moment there is no flattening of traits - all the processing after parsing needs implementing...
Monday, June 16, 2014
ochre-lang / majalan3
Copperbox revision 3153.
Ochre-lang - some work extending the top level syntax to allow modular definitions.
Majalan - changed TEMP_DIR environment variable name. I've just switched to a new development machine which highlighted this error (the previous env var name pertained to the now obsolete OM-shell).
Ochre-lang - some work extending the top level syntax to allow modular definitions.
Majalan - changed TEMP_DIR environment variable name. I've just switched to a new development machine which highlighted this error (the previous env var name pertained to the now obsolete OM-shell).
Wednesday, June 11, 2014
ochre-lang
Copperbox revision 3152.
I've added some extra syntax for instrument definitions before I start work on the translation from top-level syntax to the intermediate representation.
Instrument definitions should be thought of as (named) classes that are instantiated by an orchestra definition that supplies their instrument number (orchestra definitions are still to add to the syntax). Once I have class-like objects I hope implement something like traits to compose class fragments, modularizing the definition of instruments.
I've added some extra syntax for instrument definitions before I start work on the translation from top-level syntax to the intermediate representation.
Instrument definitions should be thought of as (named) classes that are instantiated by an orchestra definition that supplies their instrument number (orchestra definitions are still to add to the syntax). Once I have class-like objects I hope implement something like traits to compose class fragments, modularizing the definition of instruments.
Tuesday, June 10, 2014
ochre-lang
Copperbox revision 3151.
I've added a pretty printer to a s-expression format (with a bit of GHC core slipped in). This is to help me better identify what syntax forms I'm dealing with after parsing, before I start the translation from the top level syntax to the intermediate representation.
I've added a pretty printer to a s-expression format (with a bit of GHC core slipped in). This is to help me better identify what syntax forms I'm dealing with after parsing, before I start the translation from the top level syntax to the intermediate representation.
Monday, June 9, 2014
ochre-lang
Copperbox revision 3150.
I've added the K-Normal Form like intermediate syntax and the optimizations passes from the original (Haskell embedded) Ochre.
I've added the K-Normal Form like intermediate syntax and the optimizations passes from the original (Haskell embedded) Ochre.
Sunday, June 8, 2014
ochre-lang
Copperbox revision 3149.
Initial work adding syntax data types for the Csound backend. It looks like it will be better to have the K-Normal Form style immediate syntax that the original Ochre had, rather than translate to Csound from the current monadic syntax. This is good news as I can reuse much of the original Ochre.
Initial work adding syntax data types for the Csound backend. It looks like it will be better to have the K-Normal Form style immediate syntax that the original Ochre had, rather than translate to Csound from the current monadic syntax. This is good news as I can reuse much of the original Ochre.
Thursday, June 5, 2014
ochre-lang
Copperbox revision 3148.
Updated ochre-lang correcting the do-notation which didn't work previously. Because I want to implement a module system for Ochre I'm seriously thinking of developing it as a closed (i.e. not embedded) DSL, hence I've rebooted work on ochre-lang.
Updated ochre-lang correcting the do-notation which didn't work previously. Because I want to implement a module system for Ochre I'm seriously thinking of developing it as a closed (i.e. not embedded) DSL, hence I've rebooted work on ochre-lang.
Wednesday, May 21, 2014
zcsv
Copperbox revision 3147.
I've integrated the Lexer into the Parser. With the current design, this means the Parser no longer needs to be a monad. Whilst this simplifies the design I think there might still be reasons to turn Parser back into a monad (vis dropping fields, or using a different separator to comma). Certainly the organization / naming of the modules is likely to change.
I've integrated the Lexer into the Parser. With the current design, this means the Parser no longer needs to be a monad. Whilst this simplifies the design I think there might still be reasons to turn Parser back into a monad (vis dropping fields, or using a different separator to comma). Certainly the organization / naming of the modules is likely to change.
Tuesday, May 20, 2014
zcsv
Copperbox revisions 3145 and 3146.
Initial work on a lexer that should be able to decode fields during parsing (rather than parsing to a string and using read [1]). The lexer is a "standard" two continuation parser monad, but it is quite stripped down (no source position tracking, no error messages) so hopefully it should be quite fast.
Currently the lexer isn't hooked up to the main CSV parser.
[1] Because strings are expected to be short, it's moot whether it will turn out to be faster than read. However, read is specialized to Haskell values so it still seems worthwhile to have my own implementation.
Initial work on a lexer that should be able to decode fields during parsing (rather than parsing to a string and using read [1]). The lexer is a "standard" two continuation parser monad, but it is quite stripped down (no source position tracking, no error messages) so hopefully it should be quite fast.
Currently the lexer isn't hooked up to the main CSV parser.
[1] Because strings are expected to be short, it's moot whether it will turn out to be faster than read. However, read is specialized to Haskell values so it still seems worthwhile to have my own implementation.
Sunday, May 18, 2014
zcsv
Copperbox revision 3144.
I'm writing a small library to read CSV files. While Cassava is a fine library, I'm not so keen on its API; so I'm having a go at a CSV library myself.
At the moment it doesn't handle escape characters which prevents it from being any way useful but I think I'm happy with the API.
I'm writing a small library to read CSV files. While Cassava is a fine library, I'm not so keen on its API; so I'm having a go at a CSV library myself.
At the moment it doesn't handle escape characters which prevents it from being any way useful but I think I'm happy with the API.
Wednesday, May 14, 2014
orca-ix
Copperbox revision 3143.
This is a prototype looking at Yahama style digital synthesizers - Yamaha synthesizers like the DX7 had sets of algorithms (specific wiring configurations of the synthesizer units) and an interface to modify the signals going in and out of the units (enveloping them, changing their amplitude, etc).
This is a prototype looking at Yahama style digital synthesizers - Yamaha synthesizers like the DX7 had sets of algorithms (specific wiring configurations of the synthesizer units) and an interface to modify the signals going in and out of the units (enveloping them, changing their amplitude, etc).
Tuesday, May 13, 2014
majalan
Copperbox revision 3142.
I've changed Base.NoteList to use Seconds for tellNote and advanceCursor rather than Beat which is interpreted wrt. the context. Using Seconds makes for a more flexible API.
Also I've added a simple module of symbolic duration names to Majalan.Symbolic.
I've changed Base.NoteList to use Seconds for tellNote and advanceCursor rather than Beat which is interpreted wrt. the context. Using Seconds makes for a more flexible API.
Also I've added a simple module of symbolic duration names to Majalan.Symbolic.
Monday, May 12, 2014
majalan
Copperbox revision 3141.
Initial work on a more expressive note list - so far this one has notes, chords and rests.
I've also modified the first two demos - they were playing the Csound instrument wgbowedbar at a pitch outside its natural range. For what its worth, wgbowedbar is very sensitive to amplitude and should only be played with a near maximum amplitude (0.9 or higher if the orchestra uses 0dbfs, 32000 or so otherwise)
Initial work on a more expressive note list - so far this one has notes, chords and rests.
I've also modified the first two demos - they were playing the Csound instrument wgbowedbar at a pitch outside its natural range. For what its worth, wgbowedbar is very sensitive to amplitude and should only be played with a near maximum amplitude (0.9 or higher if the orchestra uses 0dbfs, 32000 or so otherwise)
Sunday, May 11, 2014
majalan
Copperbox revisions 3137, 3138, 3139, 3140.
I've reorganized the module hierarchy for Majalan:
Majalan.EventList is now Majalan.Base, Manjalan.NoteList is now Majalan.Symbolic.
Initially I tried to do this with one Subversion commit but I borked my repository, so I did it with four piecemeal commits. Horrible I know, one of these days I'll have to learn Subversion (or move to Git like everyone else).
I've reorganized the module hierarchy for Majalan:
Majalan.EventList is now Majalan.Base, Manjalan.NoteList is now Majalan.Symbolic.
Initially I tried to do this with one Subversion commit but I borked my repository, so I did it with four piecemeal commits. Horrible I know, one of these days I'll have to learn Subversion (or move to Git like everyone else).
majalan
Copperbox revision 3136.
I've moved the Majalan.NoteList.NoteList module to Majalan.EventList.NoteList and moved Majalan.EventList.Internal.Context to Majalan.EventList.Context.
These are better positions for these modules although Majalan.EventList is now misnamed - it should probably be called Majalan.Base or something like that.
I've moved the Majalan.NoteList.NoteList module to Majalan.EventList.NoteList and moved Majalan.EventList.Internal.Context to Majalan.EventList.Context.
These are better positions for these modules although Majalan.EventList is now misnamed - it should probably be called Majalan.Base or something like that.
majalan
Copperbox revisions 3134 and 3135.
I've fixed the bug in the accumulator for Events - it was the famous mempty bug for Hughes Lists / DLists. mempty for Hughes lists is id whereas the predefined mempty for functions is const mempty.
Demo02 which uses symbolic note lists is now working again.
Revision 3135 adds changes that should have gone in with 3134 but I forgot to copy the relevant file.
I've fixed the bug in the accumulator for Events - it was the famous mempty bug for Hughes Lists / DLists. mempty for Hughes lists is id whereas the predefined mempty for functions is const mempty.
Demo02 which uses symbolic note lists is now working again.
Revision 3135 adds changes that should have gone in with 3134 but I forgot to copy the relevant file.
majalan
Copperbox revision 3133.
Second round of simplifications.
I've removed JoinList as I can now make do with just a Hughes List. Additionally I've simplified building ImpulseMaps. Together with the last commit these are all the simplifications I was expecting, I've now got to re-implement symbolic note-lists which are currently broken. Plus I've got to find a bug introduced here, where events are being lost when event lists are lifted to scores.
Second round of simplifications.
I've removed JoinList as I can now make do with just a Hughes List. Additionally I've simplified building ImpulseMaps. Together with the last commit these are all the simplifications I was expecting, I've now got to re-implement symbolic note-lists which are currently broken. Plus I've got to find a bug introduced here, where events are being lost when event lists are lifted to scores.
Saturday, May 10, 2014
majalan
Copperbox revision 3132.
This is the first round of simplification permitted by changes to the Score object. I've removed both the ScoreTree data type and module (concat is no longer needed for scores) and the monoidal time span - MTimeSpan. Time spans are now always instantiated at known positions (although they might have a duration of zero) so we don't need to represent mempty.
This is the first round of simplification permitted by changes to the Score object. I've removed both the ScoreTree data type and module (concat is no longer needed for scores) and the monoidal time span - MTimeSpan. Time spans are now always instantiated at known positions (although they might have a duration of zero) so we don't need to represent mempty.
majalan
Copperbox revision 3131.
I've had a major rethink of the Score object. Rather than make it compositional (as per Doc in a pretty print library that supports horizontal and vertical concat), I've made it a finite map of systems. A score is now built by adding (elementary) systems to it - Score is expected to be a singleton within a program.
This greatly simplifies the design of the Score object. It also reduces conceptual overlap between Score and EventList which previously had similar concatenation operations [*]. Now only EventList will have concatenation.
The simplifications to Score should ripple out and lead to simplifications in the rest of the code.
[*] but confusingly different in the details...
I've had a major rethink of the Score object. Rather than make it compositional (as per Doc in a pretty print library that supports horizontal and vertical concat), I've made it a finite map of systems. A score is now built by adding (elementary) systems to it - Score is expected to be a singleton within a program.
This greatly simplifies the design of the Score object. It also reduces conceptual overlap between Score and EventList which previously had similar concatenation operations [*]. Now only EventList will have concatenation.
The simplifications to Score should ripple out and lead to simplifications in the rest of the code.
[*] but confusingly different in the details...
Thursday, May 8, 2014
majalan
Copperbox revision 3130.
I've added Context (bpm, tuning frequency...) to the Score object. This is so a score with various note lists can take the same context to evaluate them rather than use the same context at every call to evalNoteList, although I haven't yet changed to API to take advantage of this.
I haven't rushed to change the API because the module hierarchy isn't looking right any more. Improving the latter is pencilled in as the work for the weekend.
I've added Context (bpm, tuning frequency...) to the Score object. This is so a score with various note lists can take the same context to evaluate them rather than use the same context at every call to evalNoteList, although I haven't yet changed to API to take advantage of this.
I haven't rushed to change the API because the module hierarchy isn't looking right any more. Improving the latter is pencilled in as the work for the weekend.
Wednesday, May 7, 2014
majalan
Copperbox revision 3129.
I've made a rough implementation of a Note List with a "symbolic" Note type. Note-lists in this formulation are meant to resemble strings in PostScript and their evaluation with the show command (in Majalan phrase is the analogue of show).
In this formulation, retrograde transformation is simply applying reverse to the note-list / phrase.
I've made a rough implementation of a Note List with a "symbolic" Note type. Note-lists in this formulation are meant to resemble strings in PostScript and their evaluation with the show command (in Majalan phrase is the analogue of show).
In this formulation, retrograde transformation is simply applying reverse to the note-list / phrase.
Monday, May 5, 2014
majalan
Copperbox revision 3128.
Some work on NoteList - the main addition is "musically useful" horizontal concatenation. That is, the concatenation is in respect to the symbolic lengths of the phrases (length in beats) so it works sensibly vis staccato or sostenueto notes.
Some work on NoteList - the main addition is "musically useful" horizontal concatenation. That is, the concatenation is in respect to the symbolic lengths of the phrases (length in beats) so it works sensibly vis staccato or sostenueto notes.
Sunday, May 4, 2014
Saturday, May 3, 2014
majalan
Copperbox revision 3124.
I've worked up the Score and EventList structures - I think they now have most of the functionality they need in place.
Hopefully there are some simplifications of the code that I can exercise, some of internal stuff brought in when I forked mainline Majalan might not be necessary.
I've worked up the Score and EventList structures - I think they now have most of the functionality they need in place.
Hopefully there are some simplifications of the code that I can exercise, some of internal stuff brought in when I forked mainline Majalan might not be necessary.
Thursday, May 1, 2014
majalan
Copperbox revision 3123.
Work on a Score object that interprets note-lists and allows some concatenation.
Due to simplifications in majalan3 the Score object has a very simplistic notion of horizontal concatenation that might not be musically useful (as it doesn't account for symbolic note lengths vis staccato and legato notes), higher level "note lists" are obliged to define horizontal concatenation for themselves.
Work on a Score object that interprets note-lists and allows some concatenation.
Due to simplifications in majalan3 the Score object has a very simplistic notion of horizontal concatenation that might not be musically useful (as it doesn't account for symbolic note lengths vis staccato and legato notes), higher level "note lists" are obliged to define horizontal concatenation for themselves.
Wednesday, April 30, 2014
Tuesday, April 29, 2014
Monday, April 28, 2014
majalan
Copperbox revision 3120.
I've removed transformations (scale and retrograde) from the majalan3 branch. The semantics of these two transformations was subtle and I was concerned they could be hiding bugs. Any score notation built with Majalan will have to implement these transformations itself, but I expect any symbolic notation to have an easy implementation.
I've removed transformations (scale and retrograde) from the majalan3 branch. The semantics of these two transformations was subtle and I was concerned they could be hiding bugs. Any score notation built with Majalan will have to implement these transformations itself, but I expect any symbolic notation to have an easy implementation.
Sunday, April 27, 2014
majalan
Copperbox revision 3119.
I've started a redesign of Majalan - currently called majalan3.
This version considers EventList to be a helper to use when interpreting note lists, encapsulating the functionality needed to generate output. Previously EventList was seen as a base monad onto which other functionality was grafted to make more abstract note lists. The previous version quickly got too complex.
I've started a redesign of Majalan - currently called majalan3.
This version considers EventList to be a helper to use when interpreting note lists, encapsulating the functionality needed to generate output. Previously EventList was seen as a base monad onto which other functionality was grafted to make more abstract note lists. The previous version quickly got too complex.
Monday, April 14, 2014
Digital synthesis
Copperbox revision 3118.
I've started a doc summarizing what I'd like to achieve with the next tranche of work on Ochre (or Orca).
This is a bit presumptuous as I may not actually work on Ochre for quite a while, but I'm wondering if I think through my designs via writing them out it will lead to a better product than the attempts so far where I've just coded what was in my head. So far I've only written the introduction, which makes the title presumptuous (and pretentious...).
I've started a doc summarizing what I'd like to achieve with the next tranche of work on Ochre (or Orca).
This is a bit presumptuous as I may not actually work on Ochre for quite a while, but I'm wondering if I think through my designs via writing them out it will lead to a better product than the attempts so far where I've just coded what was in my head. So far I've only written the introduction, which makes the title presumptuous (and pretentious...).
Sunday, April 13, 2014
p5hs
Copperbox revision 3117.
I've added a module of Doc combinators for outputting Processing code.
This should make it simpler to iterate the design of the pretty printer - I can just write one-liners calling predefined functions rather than change the bodies of the pretty printers each time I revise the syntax.
I've added a module of Doc combinators for outputting Processing code.
This should make it simpler to iterate the design of the pretty printer - I can just write one-liners calling predefined functions rather than change the bodies of the pretty printers each time I revise the syntax.
Sunday, March 30, 2014
pretty-expr-hpj
Copperbox revision 3115.
I've added a module for printing Java expressions (needed by P5Hs).
I've added a module for printing Java expressions (needed by P5Hs).
Saturday, March 29, 2014
p5hs
Copperbox revision 3114.
I'm looking at Processing as a target for a Sunroof style compiler. A primary interest in the jni-bridge was binding to Processing-Java but maybe generating Processing code is a viable alternative (less general of course, but potentially easier and more fun).
Getting the "Generative Design" book (Bohnacker et al.) has really made me envious of Processing's "quick path to doing stuff".
I'm looking at Processing as a target for a Sunroof style compiler. A primary interest in the jni-bridge was binding to Processing-Java but maybe generating Processing code is a viable alternative (less general of course, but potentially easier and more fun).
Getting the "Generative Design" book (Bohnacker et al.) has really made me envious of Processing's "quick path to doing stuff".
Tuesday, March 25, 2014
lambola
Copperbox revision 3113.
Some work on FFI, though I've hit a problem where I can only see GetVersion inside the JNINativeInterface_ struct (in the header jni.h) and none of the other functions. I have a feeling this might scupper my plans until I set up a Linux machine to work on (developing bindings on Windows is far from fun).
Some work on FFI, though I've hit a problem where I can only see GetVersion inside the JNINativeInterface_ struct (in the header jni.h) and none of the other functions. I have a feeling this might scupper my plans until I set up a Linux machine to work on (developing bindings on Windows is far from fun).
Monday, March 24, 2014
lambola
Copperbox revision 3112.
I've started work writing the foreign function stubs.
Although this work is mechanical I'm expecting there will be quite a lot of mistakes / bugs - it's a long time (5 years) since I wrote a FFI binding and that was to OpenVG which was quite "stereotypical" and I could crib a lot from the OpenGL binding. Additionally my C skills were definitely sharper at the time, I haven't really used C (or thought about it much) since then.
I've started work writing the foreign function stubs.
Although this work is mechanical I'm expecting there will be quite a lot of mistakes / bugs - it's a long time (5 years) since I wrote a FFI binding and that was to OpenVG which was quite "stereotypical" and I could crib a lot from the OpenGL binding. Additionally my C skills were definitely sharper at the time, I haven't really used C (or thought about it much) since then.
Sunday, March 23, 2014
Invoking the JVM via JNI on Windows with MSYS
It took me quite a few hours to get the embedding example (Chapter 7 of the JNI Programmer's Guide) to work with MinGW/MSYS.
Firstly, here's the code for invoke.c, stripped of the JDK 1.1 stuff:
Firstly, here's the code for invoke.c, stripped of the JDK 1.1 stuff:
/* invoke.c */ #include <stdio.h> #include <jni.h> #define PATH_SEPARATOR ';' #define USER_CLASSPATH "." int main(void) { JNIEnv *env; JavaVM *jvm; jint res; jclass class; jmethodID mid; jstring str; jclass stringClass; JavaVMInitArgs vm_args; JavaVMOption options[1]; options[0].optionString = "-Djava.class.path=" USER_CLASSPATH; vm_args.version = 0x00010002; vm_args.options = options; vm_args.nOptions = 1; vm_args.ignoreUnrecognized = JNI_TRUE; /* Create the Java VM */ res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args); printf("Bye.\n"); destroy: if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionDescribe(env); } (*jvm)->DestroyJavaVM(jvm); return 0; }Because the jvm.dll is name mangled you need to link to the type library jvm.lib instead (this is the bit that took me a long time to find out from web searches). So this is the command I used to compile with gcc - note I have my jdk in a folder [C:\programs] so the path doesn't have spaces:
$ gcc -D_JNI_IMPLEMENTATION -I/c/programs/java/jdk1.7.0_51/include -I/c/programs/java/jdk1.7.0_51/include/win32 invoke.c -L/c/programs/java/jdk1.7.0_51/lib -ljvm -o invoke.exeTo run I had to add the path to the "client vm" in my Bash path:
$ PATH=$PATH:/c/programs/java/jdk1.7.0_51/jre/bin/client $ export PATHFinally I could just run
$ ./invoke.exe
Monday, March 17, 2014
lambola
Copperbox revision 3110.
I've made a new prototype for name rewriting.
Name rewriting is split into three phases - tokenizing, rewriting words and recombining. This strategy is not so general, but it does seem to capture the uses cases I have in mind for rewriting variable names to meet language conventions (i.e. C, IDL and Java to Haskell and vice versa). The prototype will need some polish - particularly I need to decide whether to support typed tokens (words) or just Strings. "Just Strings" will have a simpler API if I can get by without more types.
I've made a new prototype for name rewriting.
Name rewriting is split into three phases - tokenizing, rewriting words and recombining. This strategy is not so general, but it does seem to capture the uses cases I have in mind for rewriting variable names to meet language conventions (i.e. C, IDL and Java to Haskell and vice versa). The prototype will need some polish - particularly I need to decide whether to support typed tokens (words) or just Strings. "Just Strings" will have a simpler API if I can get by without more types.
Monday, March 10, 2014
Sunday, March 9, 2014
Saturday, March 8, 2014
lambola
Copperbox revision 3107.
I've changed the (initial) translation code to use Template Haskell rather than build Haskell-src-exts abstract syntax. The improvement is evident - I don't know why I didn't think to use Template Haskell in the first place.
I've also started to look at name-wrangling (which seems a more purposeful nomination than name-mangling), it looks like I'll need something sort of combinator library for this.
I've changed the (initial) translation code to use Template Haskell rather than build Haskell-src-exts abstract syntax. The improvement is evident - I don't know why I didn't think to use Template Haskell in the first place.
I've also started to look at name-wrangling (which seems a more purposeful nomination than name-mangling), it looks like I'll need something sort of combinator library for this.
Thursday, March 6, 2014
lambola
Copperbox revision 3105.
I've implemented an Alex lexer so now there is enough code to import the Happy parser - which currently has some type errors. I expect there are "proper" errors in the parser (errors in the implementation) to find once it compiles.
I've implemented an Alex lexer so now there is enough code to import the Happy parser - which currently has some type errors. I expect there are "proper" errors in the parser (errors in the implementation) to find once it compiles.
Wednesday, March 5, 2014
lambola
Copperbox revision 3104.
I've fleshed out all the productions of the Happy parser, but Happy tells me it has 4 unused rules so some productions must be incomplete. There will be more bugs - I haven't written a lexer yet so can't even type check the generated code.
I've fleshed out all the productions of the Happy parser, but Happy tells me it has 4 unused rules so some productions must be incomplete. There will be more bugs - I haven't written a lexer yet so can't even type check the generated code.
Tuesday, March 4, 2014
Monday, March 3, 2014
lambola
Copperbox revision 3102.
I've moved the IDL code (parser, syntax, pretty printer) into the Lambola namespace, if I think Lambola (eventually) merits a release I don't think the IDL code will ever be canonical enough to merit the Language.IDL namespace.
Also, I've started work on a Happy parser. This should be more robust than the current Parsec parser as the IDL grammar specification is already in LR form. Ideally I would have carried on with yesterday's work on IDL-to-Haskell translation, but I'm not sure of the status of libraries for Haskell quasiquoting on Hackage. Quasiquoting will need some investigation and I was concerned it might have interfered with my intention for "a commit a day".
I've moved the IDL code (parser, syntax, pretty printer) into the Lambola namespace, if I think Lambola (eventually) merits a release I don't think the IDL code will ever be canonical enough to merit the Language.IDL namespace.
Also, I've started work on a Happy parser. This should be more robust than the current Parsec parser as the IDL grammar specification is already in LR form. Ideally I would have carried on with yesterday's work on IDL-to-Haskell translation, but I'm not sure of the status of libraries for Haskell quasiquoting on Hackage. Quasiquoting will need some investigation and I was concerned it might have interfered with my intention for "a commit a day".
Sunday, March 2, 2014
lambola
Copperbox revision 3101.
Minor fixes and initial work on translating IDL definitions to Haskell.
It looks like using a quasi-quoter is going to be essential, then I should be able to achieve a translation quite close to the original H/Direct paper. So far I've just used Haskell-src-exts which is rather cumbersome.
Side issue - the "patch" I posted yesterday for H/Direct gets the H/Direct generator to compile but ignores the runtime library. Getting the runtime library working looks like it would be difficult, as it calls primitives that are seemingly unknown to GHC.
Minor fixes and initial work on translating IDL definitions to Haskell.
It looks like using a quasi-quoter is going to be essential, then I should be able to achieve a translation quite close to the original H/Direct paper. So far I've just used Haskell-src-exts which is rather cumbersome.
Side issue - the "patch" I posted yesterday for H/Direct gets the H/Direct generator to compile but ignores the runtime library. Getting the runtime library working looks like it would be difficult, as it calls primitives that are seemingly unknown to GHC.
Saturday, March 1, 2014
H/Direct patch
Below is a diff to get Don Stewart's package of H/Direct on Hackage to compile with the latest Platform (2013.2.0.0):
diff --recursive hdirect//hdirect.cabal /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/hdirect.cabal 59,62c59,60 < build-depends: base >= 2 && < 5, < old-locale >= 1 && <= 1.1, < old-time >= 1.1 && <= 1.2, < process >= 1.0 && <= 1.2, --- > build-depends: haskell98, > base >= 2 && < 5, 69,72c67,68 < build-depends: base >= 2 && < 5, < old-locale >= 1 && <= 1.1, < old-time >= 1.0 && <= 1.2, < process >= 1.0 && <= 1.2, --- > build-depends: haskell98, > base >= 2 && < 5, Only in hdirect/: hdirect.cabal~ diff --recursive hdirect//src/AbsHUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/AbsHUtils.lhs 199,201c199,201 < import Data.Maybe ( fromMaybe, isJust ) < import Data.Char ( isLower ) < import Data.List ( mapAccumL, intersperse ) --- > import Maybe ( fromMaybe, isJust ) > import Char ( isLower ) > import List ( mapAccumL, intersperse ) diff --recursive hdirect//src/Attribute.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Attribute.lhs 17c17 < import Data.List ( find ) --- > import List ( find ) 19c19 < import Data.Maybe ( mapMaybe ) --- > import Maybe ( mapMaybe ) diff --recursive hdirect//src/Bag.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Bag.lhs 19c19 < import Data.List(partition) --- > import List(partition) diff --recursive hdirect//src/BasicTypes.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/BasicTypes.lhs 54c54 < import Data.Maybe ( fromMaybe ) --- > import Maybe ( fromMaybe ) 57c57 < import Data.Int --- > import Int diff --recursive hdirect//src/CStubGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CStubGen.lhs 18,19c18,19 < import Data.List ( nub ) < import Data.Maybe ( isJust ) --- > import List ( nub ) > import Maybe ( isJust ) diff --recursive hdirect//src/CgMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CgMonad.lhs 86c86 < import Data.Maybe ( fromMaybe ) --- > import Maybe ( fromMaybe ) diff --recursive hdirect//src/CodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CodeGen.lhs 57c57 < import Data.List ( partition, intersperse, isPrefixOf ) --- > import List ( partition, intersperse, isPrefixOf ) 61,62c61,62 < import Data.Maybe ( mapMaybe, isJust ) < import Control.Monad ( when ) --- > import Maybe ( mapMaybe, isJust ) > import Monad ( when ) diff --recursive hdirect//src/CoreIDL.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreIDL.lhs 16c16 < import Data.Int ( Int32 ) --- > import Int ( Int32 ) diff --recursive hdirect//src/CoreUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreUtils.lhs 211,213c211,213 < import Data.Maybe ( mapMaybe, fromMaybe, mapMaybe, isJust ) < import Data.List ( partition, find, nub, mapAccumL ) < import Data.Char ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit ) --- > import Maybe ( mapMaybe, fromMaybe, mapMaybe, isJust ) > import List ( partition ) > import Char ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit ) 217,219c217,219 < import Data.Int < -- import List < import Data.Bits --- > import Int > import List > import Bits diff --recursive hdirect//src/DefGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DefGen.lhs 10c10 < import Data.List --- > import List diff --recursive hdirect//src/Desugar.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Desugar.lhs 56,60c56,60 < import Data.Int < import Control.Monad < import Data.Maybe ( isJust, fromJust, fromMaybe ) < import Data.Char ( toLower, isSpace ) < import Data.List ( partition, sort, sortBy, isPrefixOf ) --- > import Int > import Monad > import Maybe ( isJust, fromJust, fromMaybe ) > import Char ( toLower, isSpace ) > import List ( partition, sort, sortBy, isPrefixOf ) diff --recursive hdirect//src/Digraph.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Digraph.lhs 38,40c38,40 < import Data.Maybe < import Data.Array < import Data.List ( sortBy, (\\) ) --- > import Maybe > import Array > import List ( sortBy, (\\) ) diff --recursive hdirect//src/DsMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DsMonad.lhs 83,85c83,85 < import System.IO ( hPutStrLn, stderr ) < import Data.Int ( Int32 ) < import Control.Monad ( when ) --- > import IO ( hPutStrLn, stderr ) > import Int ( Int32 ) > import Monad ( when ) 87c87 < import Data.Maybe ( catMaybes ) --- > import Maybe ( catMaybes ) diff --recursive hdirect//src/FiniteMap.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/FiniteMap.lhs 51c51 < import Data.Maybe( isJust ) --- > import Maybe( isJust ) diff --recursive hdirect//src/GetOpt.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/GetOpt.lhs 74c74 < import Control.Monad --- > import Monad diff --recursive hdirect//src/HugsCodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/HugsCodeGen.lhs 18c18 < import Data.List ( nub, intersperse ) --- > import List ( nub, intersperse ) diff --recursive hdirect//src/IDLUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/IDLUtils.lhs 112,114c112,114 < import Data.Int < import Data.Word ( Word16 ) < import Data.Bits --- > import Int > import Word ( Word16 ) > import Bits 116,117c116,117 < import Data.List ( isPrefixOf, find ) < import Data.Char ( isDigit, isAlpha, isSpace ) --- > import List ( isPrefixOf, find ) > import Char ( isDigit, isAlpha, isSpace ) 120,121c120,121 < import Data.Maybe < import Control.Monad --- > import Maybe > import Monad diff --recursive hdirect//src/JavaProxy.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/JavaProxy.lhs 24c24 < import Data.Maybe ( mapMaybe ) --- > import Maybe ( mapMaybe ) diff --recursive hdirect//src/Lex.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Lex.lhs 16c16 < import Data.Char --- > import Char 19c19 < import Data.List ( isPrefixOf ) --- > import List ( isPrefixOf ) diff --recursive hdirect//src/LexM.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/LexM.lhs 57,59c57,59 < import System.IO ( hPutStrLn, stderr ) < import Control.Monad ( when ) < import Data.Char ( toLower ) --- > import IO ( hPutStrLn, stderr ) > import Monad ( when ) > import Char ( toLower ) diff --recursive hdirect//src/Literal.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Literal.lhs 25c25 < import Data.List ( intersperse ) --- > import List ( intersperse ) diff --recursive hdirect//src/Main.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Main.lhs 31,33c31 < import Control.Exception ( catch ) < import System.Time ( getClockTime, toCalendarTime, formatCalendarTime ) < import System.IO ( hPutStr, hPutStrLn, stderr, stdout, hPutChar, --- > import IO ( hPutStr, hPutStrLn, stderr, stdout, hPutChar, 36,38c34,35 < import Control.Monad ( when ) < import System.Environment ( getProgName ) < import System.Exit ( exitWith, ExitCode(..) ) --- > import Monad ( when ) > import System (getProgName, exitWith, ExitCode(..) ) 41,42c38,39 < -- import Data.Time < import Data.List ( partition ) --- > import Time > import List ( partition ) 44c41 < import System.Locale --- > import Locale diff --recursive hdirect//src/MarshallAuto.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallAuto.lhs 34c34 < import Data.Maybe ( isJust ) --- > import Maybe ( isJust ) diff --recursive hdirect//src/MarshallCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallCore.lhs 56,57c56,57 < import Data.Maybe < import Data.List ( nub ) --- > import Maybe > import List ( nub ) diff --recursive hdirect//src/MarshallDep.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallDep.lhs 31,33c31,33 < import Data.List ( nubBy ) < import Data.Maybe ( mapMaybe, fromMaybe, fromJust, isJust ) < import Control.Monad ( when ) --- > import List ( nubBy ) > import Maybe ( mapMaybe, fromMaybe, fromJust, isJust ) > import Monad ( when ) diff --recursive hdirect//src/MarshallFun.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallFun.lhs 31c31 < import Data.Maybe --- > import Maybe diff --recursive hdirect//src/MarshallJNI.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallJNI.lhs 34,35c34,35 < import Control.Monad ( when ) < import Data.Maybe ( mapMaybe ) --- > import Monad ( when ) > import Maybe ( mapMaybe ) diff --recursive hdirect//src/MarshallMethod.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallMethod.lhs 96,97c96,97 < import Data.Maybe ( fromMaybe, isJust, fromJust ) < import Control.Monad ( when, mplus ) --- > import Maybe ( fromMaybe, isJust, fromJust ) > import Monad ( when, mplus ) diff --recursive hdirect//src/MarshallServ.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallServ.lhs 47,48c47,48 < import Control.Monad ( when ) < import Data.Maybe --- > import Monad ( when ) > import Maybe diff --recursive hdirect//src/MarshallStruct.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallStruct.lhs 40,41c40,41 < import Data.List ( findIndex, partition ) < import Data.Maybe ( mapMaybe ) --- > import List ( findIndex, partition ) > import Maybe ( mapMaybe ) diff --recursive hdirect//src/MarshallType.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallType.lhs 50c50 < import Data.Maybe ( fromMaybe, isJust, fromJust ) --- > import Maybe ( fromMaybe, isJust, fromJust ) diff --recursive hdirect//src/MarshallUnion.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUnion.lhs 26c26 < import Data.Char ( ord ) --- > import Char ( ord ) diff --recursive hdirect//src/MarshallUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUtils.lhs 45c45 < import Data.List ( intersperse ) --- > import List ( intersperse ) diff --recursive hdirect//src/MkImport.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MkImport.lhs 24c24 < import Data.List ( nub ) --- > import List ( nub ) diff --recursive hdirect//src/Opts.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Opts.lhs 13,14c13 < import System.Environment ( getArgs ) < -- import System --- > import System 16,17c15,16 < import System.IO ( hPutStrLn, stderr ) < import Control.Monad ( when ) --- > import IO ( hPutStrLn, stderr ) > import Monad ( when ) diff --recursive hdirect//src/Parser.hs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.hs 34c34 < import System.IO ( hPutStrLn, stderr ) --- > import IO ( hPutStrLn, stderr ) diff --recursive hdirect//src/Parser.y /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.y 32c32 < import System.IO ( hPutStrLn, stderr ) --- > import IO ( hPutStrLn, stderr ) diff --recursive hdirect//src/PpAbstractH.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpAbstractH.lhs 43c43 < import Data.Char ( isAlpha ) --- > import Char ( isAlpha ) diff --recursive hdirect//src/PpCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpCore.lhs 20c20 < import Data.List ( partition ) --- > import List ( partition ) 24,25c24,25 < import Data.Maybe ( fromMaybe ) < import Data.Char ( isAlphaNum, toUpper ) --- > import Maybe ( fromMaybe ) > import Char ( isAlphaNum, toUpper ) diff --recursive hdirect//src/PpIDLSyn.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpIDLSyn.lhs 16c16 < import Data.Maybe --- > import Maybe diff --recursive hdirect//src/PreProc.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PreProc.lhs 1,2d0 < > {-# LANGUAGE ScopedTypeVariables #-} < 20d17 < import Control.Exception ( catch ) 22,24c19,20 < import System.CPUTime < import System.Environment ( getEnv ) < import System.Process ( system ) --- > import CPUTime > import System ( getEnv, system ) 26c22 < import Data.List ( intersperse ) --- > import List ( intersperse ) 28c24 < -- import IO --- > import IO 30c26 < import Control.Monad --- > import Monad 48c44 < (\ (_ :: IOError) -> return "/tmp/") --- > (\ _ -> return "/tmp/") 73c69 < (\(_ :: IOError)-> return ("gcc -E -x c")) --- > (\ _ -> return ("gcc -E -x c")) 86c82 < ( \ (_ :: IOError)-> return "/tmp/") --- > ( \ _ -> return "/tmp/") 89c85 < ( \ (_ :: IOError)-> return "rm -f") --- > ( \ _ -> return "rm -f") diff --recursive hdirect//src/Rename.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Rename.lhs 55,58c55,58 < import Data.Maybe ( isJust, fromMaybe ) < import Data.List ( isPrefixOf ) < import Control.Monad ( when, mplus ) < import Data.Char ( isUpper, toUpper ) --- > import Maybe ( isJust, fromMaybe ) > import List ( isPrefixOf ) > import Monad ( when, mplus ) > import Char ( isUpper, toUpper ) diff --recursive hdirect//src/RnMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/RnMonad.lhs 63c63 < import Data.Maybe ( isJust ) --- > import Maybe ( isJust ) diff --recursive hdirect//src/Skeleton.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Skeleton.lhs 21c21 < import Data.List ( partition ) --- > import List ( partition ) diff --recursive hdirect//src/TypeInfo.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/TypeInfo.lhs 27c27 < import Data.Maybe --- > import Maybe diff --recursive hdirect//src/Utils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Utils.lhs 1,2d0 < > {-# LANGUAGE ScopedTypeVariables #-} < 55,56c53 < import Data.Char (chr, ord, readLitChar) < import Control.Exception ( catch ) --- > import Char (chr, ord, readLitChar) 58c55,56 < import Data.Int --- > import IO > import Int 60c58 < import System.Directory --- > import Directory 62,63c60,61 < import Control.Monad ( when ) < import Data.List ( mapAccumL, isPrefixOf ) --- > import Monad ( when ) > import List ( mapAccumL, isPrefixOf ) 283c281 < `catch` (\ (_::IOError) -> return False) --- > `catch` (\ _ -> return False)
Thursday, February 27, 2014
Wednesday, February 26, 2014
lambola
Copperbox revision 3099.
More work on the pretty printer plus another improvement / correction to the syntax and parser.
Initial tests show the parser is working quite well although I still suspect it may have problems with constant expressions (and left recursion).
More work on the pretty printer plus another improvement / correction to the syntax and parser.
Initial tests show the parser is working quite well although I still suspect it may have problems with constant expressions (and left recursion).
Tuesday, February 25, 2014
Monday, February 24, 2014
Sunday, February 23, 2014
lambola
Copperbox revision 3096.
I've fleshed out the IDL parser so that there is a parser for all the productions in the Corba 2.0 IDL specification (OMG IDL gets increasingly huge after version 2.0).
The parser is so far untested - errors are expected as the grammar in the spec appears to be LR not LL. Also, the syntax datatypes seem to be sufficient to represent the grammar but might not be a good design - again I expect them to change.
I've fleshed out the IDL parser so that there is a parser for all the productions in the Corba 2.0 IDL specification (OMG IDL gets increasingly huge after version 2.0).
The parser is so far untested - errors are expected as the grammar in the spec appears to be LR not LL. Also, the syntax datatypes seem to be sufficient to represent the grammar but might not be a good design - again I expect them to change.
Saturday, February 22, 2014
lambola
Copperbox revision 3095.
I've started a new project Lambola to look at Haskell - Java interop inspired by Meijer and Finne's Lambada. The name is a pun on Lambada and the dance invented by Greta Gerwig in Damsels in Distress - the sambola.
I imagine there's a lot of work involved in this project, but I think it should be amenable to piecemeal work (so hopefully I can get back to a Copperbox commit most days) and anything that raises the status of Haskell / Java interop will be a benefit to the Haskell community even if it is only a prototype / proof-of-concept.
Initially I'm working on a Parsec IDL parser.
I've started a new project Lambola to look at Haskell - Java interop inspired by Meijer and Finne's Lambada. The name is a pun on Lambada and the dance invented by Greta Gerwig in Damsels in Distress - the sambola.
I imagine there's a lot of work involved in this project, but I think it should be amenable to piecemeal work (so hopefully I can get back to a Copperbox commit most days) and anything that raises the status of Haskell / Java interop will be a benefit to the Haskell community even if it is only a prototype / proof-of-concept.
Initially I'm working on a Parsec IDL parser.
Wednesday, February 12, 2014
concepts
Copperbox revision 3094.
I have implemented Christian Lindig's LATTICE algorithm after all, so now I can build concept lattices. My implementation is derived from Joost Visser's code that was published on the PURe group's CVS repository.
I won't delete concepts from Copperbox, but it is unlikely I'll do any more work on it.
I have implemented Christian Lindig's LATTICE algorithm after all, so now I can build concept lattices. My implementation is derived from Joost Visser's code that was published on the PURe group's CVS repository.
I won't delete concepts from Copperbox, but it is unlikely I'll do any more work on it.
Tuesday, February 11, 2014
concepts
Copperbox revision 3093.
I've corrected the NEIGHBORS algorithm so it produces a list of concepts - previously it was concatenating neighbors into a single concept. However, I'm not 100% sure this is correct and as I'm finding implementing the Fast FCA algorithm hard going I'm going to bow out with it unfinished.
I will delete the concepts folder from Copperbox as it isn't going to progress beyond a doodle.
I've corrected the NEIGHBORS algorithm so it produces a list of concepts - previously it was concatenating neighbors into a single concept. However, I'm not 100% sure this is correct and as I'm finding implementing the Fast FCA algorithm hard going I'm going to bow out with it unfinished.
I will delete the concepts folder from Copperbox as it isn't going to progress beyond a doodle.
Monday, February 10, 2014
concepts
Copperbox revision 3092.
I've implemented the prime operator (twice). In the literature on Formal Concept Analysis prime seems to be overloaded for two functions:
' : P(O) -> P(A)
(... deriving the set of shared attributes for all objects in a given set)
' : P(A) -> P(O)
(... deriving the set of objects sharing a given set of attributes)
I've implemented the prime operator (twice). In the literature on Formal Concept Analysis prime seems to be overloaded for two functions:
' : P(O) -> P(A)
(... deriving the set of shared attributes for all objects in a given set)
' : P(A) -> P(O)
(... deriving the set of objects sharing a given set of attributes)
Sunday, February 9, 2014
concepts
Copperbox revision 3091.
I've started a small prototype / doodle to implement Christian Lindig's algorithms for (fast) Formal Concept Analysis.
At the moment I'm a bit stuck as I don't see what the derivation / prime operator is doing in the algorithm NEIGHBORS.
I've started a small prototype / doodle to implement Christian Lindig's algorithms for (fast) Formal Concept Analysis.
At the moment I'm a bit stuck as I don't see what the derivation / prime operator is doing in the algorithm NEIGHBORS.
Sunday, January 26, 2014
ochre-lang
Copperbox revision 3090.
I've added a pretty pretty for the language so far defined. I'll have to at least add a module language - the idea is to allow synthesizer components and so components need to be available as libraries.
I've added a pretty pretty for the language so far defined. I'll have to at least add a module language - the idea is to allow synthesizer components and so components need to be available as libraries.
Saturday, January 25, 2014
ochre-lang
Copperbox revision 3089.
I've started work on a new prototype implementation of Ochre looking towards making it a closed DSL rather than an embedded one.
Last time I worked on Ochre (actually Orca) I found it hard both to type programs in Ochre+Haskell and to get an agreeable form of late-binding to allow synthesizer components. My feeling is both might be easier with a standalone DSL.
I've started work on a new prototype implementation of Ochre looking towards making it a closed DSL rather than an embedded one.
Last time I worked on Ochre (actually Orca) I found it hard both to type programs in Ochre+Haskell and to get an agreeable form of late-binding to allow synthesizer components. My feeling is both might be easier with a standalone DSL.
Wednesday, January 22, 2014
config-check
Copperbox revision 3088.
I've added a Writer to the CheckCode monad, so it can record explanations of why a check fails. Previously I tried to use an error type that built a stack of errors, but using a Writer seems simpler.
I've added a Writer to the CheckCode monad, so it can record explanations of why a check fails. Previously I tried to use an error type that built a stack of errors, but using a Writer seems simpler.
Monday, January 20, 2014
config-check
Copperbox revision 3087.
I've made the assert combinators more uniform, adding underscore suffix versions that don't take an error message builder. Also I've added wrappers over Text.printf to build error messages - although I'm usually sanguine about Text.printf here it is too useful to ignore.
I've made the assert combinators more uniform, adding underscore suffix versions that don't take an error message builder. Also I've added wrappers over Text.printf to build error messages - although I'm usually sanguine about Text.printf here it is too useful to ignore.
config-check
Copperbox revision 3086.
More work on the checker combinators, especially improving the naming convention.
More work on the checker combinators, especially improving the naming convention.
config-check
Copperbox revision 3085.
I've changed the internal representation of Checkers so that the base monad doesn't support failure (failure is pushed into the non-polymorphic Result type). This means we lose the Alternative and MonadPlus instances, but we gain better error messages and simplicity (no need for ShortCircuitOkay).
I've changed the internal representation of Checkers so that the base monad doesn't support failure (failure is pushed into the non-polymorphic Result type). This means we lose the Alternative and MonadPlus instances, but we gain better error messages and simplicity (no need for ShortCircuitOkay).
Sunday, January 19, 2014
config-check
Copperbox revision 3084.
I've changed the built-in report printer to use Text.PrettyPrint.HughesPJ - this stops me re-inventing some wheels and allows nicer output.
I've changed the built-in report printer to use Text.PrettyPrint.HughesPJ - this stops me re-inventing some wheels and allows nicer output.
config-check
Copperbox revision 3083.
I've added simplistic reporting to make the final output more user friendly. Reporting is just pretty printing of the new CheckReport data type - a less simplistic report printer could output as HTML for example.
I've added simplistic reporting to make the final output more user friendly. Reporting is just pretty printing of the new CheckReport data type - a less simplistic report printer could output as HTML for example.
Saturday, January 18, 2014
config-check
Copperbox revision 3082.
I've changed the Checker module to re-export the forward and reverse composition operators from Control.Category - (<<<) and (>>>) - rather than define my own. I've also added two new sample checkers.
I've changed the Checker module to re-export the forward and reverse composition operators from Control.Category - (<<<) and (>>>) - rather than define my own. I've also added two new sample checkers.
Wednesday, January 15, 2014
config-check
Copperbox revision 3081.
I've changed to sample checkers to use paths defined with reverse function composition (to get a left-to-right reading) and applied with the focus function, rather than use an operator that aliased the focus function.
Using an operator for focus introduced problems with precedence that snagged up the code. Excepting the introduction of a reverse composition operator, checkers look like good old, simple Haskell again (albeit without explicit pattern matching).
I've changed to sample checkers to use paths defined with reverse function composition (to get a left-to-right reading) and applied with the focus function, rather than use an operator that aliased the focus function.
Using an operator for focus introduced problems with precedence that snagged up the code. Excepting the introduction of a reverse composition operator, checkers look like good old, simple Haskell again (albeit without explicit pattern matching).
Tuesday, January 14, 2014
config-check
Copperbox revision 3080.
I've added assert_ versions of the only_ combinators that fail if the assert fails (rather than short-circuit).
I've added assert_ versions of the only_ combinators that fail if the assert fails (rather than short-circuit).
Monday, January 13, 2014
config-check
Copperbox revision 3079.
I've tidied up the the datatype names in the Checker module so that the most important objects get the best names. Also I've moved all the sample checkers out of the Demo01 module into HydroChecks module.
I've tidied up the the datatype names in the Checker module so that the most important objects get the best names. Also I've moved all the sample checkers out of the Demo01 module into HydroChecks module.
config-check
Copperbox revision 3078.
I've added GroupChecker (should probably be called CheckerGroup) to group together related checkers and started moving the sample checkers into a separate module.
I've added GroupChecker (should probably be called CheckerGroup) to group together related checkers and started moving the sample checkers into a separate module.
config-check
Copperbox revision 3077.
I've extended the Checker datatypes with description and priority (priority is a open measure of severity e.g. Fail | Warn). These should help the Checker runner to create more informative reports.
I've extended the Checker datatypes with description and priority (priority is a open measure of severity e.g. Fail | Warn). These should help the Checker runner to create more informative reports.
Sunday, January 12, 2014
config-check
Copperbox revision 3076.
I've added a counting checker and specialized variants exactly, atmost and atleast that work on Foldables. Actually, I thought these checkers went in commit 3075, so the Svn comment mentions that I fixed a bug in the counting checker.
I've also added more sample data - this should inspire me to write more test checkers.
I've added a counting checker and specialized variants exactly, atmost and atleast that work on Foldables. Actually, I thought these checkers went in commit 3075, so the Svn comment mentions that I fixed a bug in the counting checker.
I've also added more sample data - this should inspire me to write more test checkers.
config-check
Copperbox revision 3075.
I've generalized imall (now called checkall) to work with any Foldable structure. Previously it was specific to IntMap.
I've generalized imall (now called checkall) to work with any Foldable structure. Previously it was specific to IntMap.
Saturday, January 11, 2014
config-check
Copperbox revision 3074.
Some changes to type names and some code clean up.
Initially this revision was an attempt to simplify the implementation of the CheckCode monad by changing success from Okay True (with both Okay False and Fail msg as failure) to Okay () as success and Fail msg as failure. However this change made it difficult to write Applicative checkers (they needed an extra lifter) and imall became more difficult to think about.
Some changes to type names and some code clean up.
Initially this revision was an attempt to simplify the implementation of the CheckCode monad by changing success from Okay True (with both Okay False and Fail msg as failure) to Okay () as success and Fail msg as failure. However this change made it difficult to write Applicative checkers (they needed an extra lifter) and imall became more difficult to think about.
Wednesday, January 8, 2014
config-check
Copperbox revision 3073.
I've improved on yesterday's "operational leak" by using a new onlyJust combinator.
That said, as I add combinators I'm becoming aware that set of combinators is getting wilder rather than more uniform and the style of writing checkers with "path projections" is - shall we say - individual (i.e. not idiomatic Haskell).
I've improved on yesterday's "operational leak" by using a new onlyJust combinator.
That said, as I add combinators I'm becoming aware that set of combinators is getting wilder rather than more uniform and the style of writing checkers with "path projections" is - shall we say - individual (i.e. not idiomatic Haskell).
Tuesday, January 7, 2014
config-check
Copperbox revision 3072.
I've implemented a new combinator imall to apply a checker to all members of an IntMap based an all in Data.List. Unfortunately imall has an operational leak when combined with pattern matching on cases - we must know that uninteresting cases have to produce True so that all (interesting) cases can be combined to produce True for a successful check.
Ideally I'd like to avoid pattern matching for uninteresting cases but as pattern matching is built-in to Haskell this would generate Non-exhaustive pattern exceptions.
I've implemented a new combinator imall to apply a checker to all members of an IntMap based an all in Data.List. Unfortunately imall has an operational leak when combined with pattern matching on cases - we must know that uninteresting cases have to produce True so that all (interesting) cases can be combined to produce True for a successful check.
Ideally I'd like to avoid pattern matching for uninteresting cases but as pattern matching is built-in to Haskell this would generate Non-exhaustive pattern exceptions.
Monday, January 6, 2014
config-check
Copperbox revision 3071.
I've added an onlyif combinator that proceeds only if the initial guard is true, but doesn't fail if it isn't. This will allow conditional checkers that don't produce warnings if they aren't relevant.
I've had to change the internal answer type from a simple Either to accommodate the short-circuit success that onlyif needs.
I've added an onlyif combinator that proceeds only if the initial guard is true, but doesn't fail if it isn't. This will allow conditional checkers that don't produce warnings if they aren't relevant.
I've had to change the internal answer type from a simple Either to accommodate the short-circuit success that onlyif needs.
Sunday, January 5, 2014
config-check
Copperbox revision 3070.
Minor style changes to improve writing checkers - the path operator[*] has been given a very low precedence which lets it play well with the Applicative combinators.
Added an mget combinator to make projections (gets) returning Maybe values deterministic - code can act as if the projection is successful, if it has failed it is transparently caught by the underlying Either monad.
[*] The path operator has changed its ASCII name. The current name may not be final - naming ASCII operators is a bane of programming in Haskell.
Minor style changes to improve writing checkers - the path operator[*] has been given a very low precedence which lets it play well with the Applicative combinators.
Added an mget combinator to make projections (gets) returning Maybe values deterministic - code can act as if the projection is successful, if it has failed it is transparently caught by the underlying Either monad.
[*] The path operator has changed its ASCII name. The current name may not be final - naming ASCII operators is a bane of programming in Haskell.
config-check
Copperbox revision 3069.
More work on ConfigCheck, particularly it now has a run function that runs multiple checkers on a configuration and returns a list of failures.
Also, it seems (top-level) pattern matching would not be that valuable for writing checkers - configs are expected to have many fields so pattern matching is cumbersome. This is fine - it means there is not much loss of clarity / directness if we bury the config in a Reader monad (which forfeits top-level pattern matching).
More work on ConfigCheck, particularly it now has a run function that runs multiple checkers on a configuration and returns a list of failures.
Also, it seems (top-level) pattern matching would not be that valuable for writing checkers - configs are expected to have many fields so pattern matching is cumbersome. This is fine - it means there is not much loss of clarity / directness if we bury the config in a Reader monad (which forfeits top-level pattern matching).
Saturday, January 4, 2014
config-check
Copperbox revision 3068.
A new project / tool for validating configurations.
A configuration is some user data represented as normal Haskell datatypes - however it is expected that configurations will already contain some errors (or at least bad smells) - after all, the configuration may originally be specified in XML, as text etc. Thus, the standard Haskell Way of developing highly refined datatypes with advanced type system features that prevent errors won't work for us, instead ConfigCheck tests instantiated simple datatypes (configurations) with Lint-like rules that identify bad or erroneous data.
The core of ConfigCheck is a static parser monad - i.e. a parser monad that doesn't consume input (it is expected to make multiple, user-directed passes over the Config datatypes). Designing the static parser monad is easy; designing a good API / set of combinators to specify rules already looks more challenging. I'm not sure the API should even look like the regular parser monad combinators Haskell programmers are used to.
A new project / tool for validating configurations.
A configuration is some user data represented as normal Haskell datatypes - however it is expected that configurations will already contain some errors (or at least bad smells) - after all, the configuration may originally be specified in XML, as text etc. Thus, the standard Haskell Way of developing highly refined datatypes with advanced type system features that prevent errors won't work for us, instead ConfigCheck tests instantiated simple datatypes (configurations) with Lint-like rules that identify bad or erroneous data.
The core of ConfigCheck is a static parser monad - i.e. a parser monad that doesn't consume input (it is expected to make multiple, user-directed passes over the Config datatypes). Designing the static parser monad is easy; designing a good API / set of combinators to specify rules already looks more challenging. I'm not sure the API should even look like the regular parser monad combinators Haskell programmers are used to.
Wednesday, January 1, 2014
OpenVG-0.7.0 and OpenVGRaw-0.4.0 - new releases
Copperbox revision 3067.
I've made new releases of OpenVG and OpenVGRaw for Hackage. These fix build problems encountered with GHC 7.6.3 and work with Platform 2013.2.0.0.
I've made new releases of OpenVG and OpenVGRaw for Hackage. These fix build problems encountered with GHC 7.6.3 and work with Platform 2013.2.0.0.
OpenVG and OpenVGRaw
Copperbox revisions 3065 and 3066.
I've updated the Windows install instructions. Revision 3065 mixed up changes between OpenVG and OpenVGRaw - revision 3066 fixed this slip.
I've updated the Windows install instructions. Revision 3065 mixed up changes between OpenVG and OpenVGRaw - revision 3066 fixed this slip.
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2014
(200)
-
►
July
(46)
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- zcsv
- zcsv
- majalan
- majalan
- majalan
- majalan
- majalan
- majalan
- bala - package cull
- majalan
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- algorave
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
- ochre-lang
-
►
January
(25)
- ochre-lang
- ochre-lang
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- config-check
- OpenVG-0.7.0 and OpenVGRaw-0.4.0 - new releases
- OpenVG and OpenVGRaw
-
►
July
(46)
About Me
- Stephen Tetley
- Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.