Rainer Schuetz wrote on 24/07/2020 11:50:
> Dear Bernard ’n friends,
>
>> Dear Rainer,
>>
>> It is great that you are following development trying things on different systems. For instance, the question remains open regarding paths in command lines that contain spaces: is it ok to pack them between quotes or should we replace them backslash spaces?
> The only simple answer I know is: no. Quotes can be swallowed by parsers, and backslash is not recognised by Windows as escape character (Instead it is used as directory separator in paths - OMG!!!. Windows uses ^ instead of \, and in some cases it works, but not reliably. It’s a bit like that keyboard problem we spoke about like 10 years ago, so many layers of reinterpretation interact that it’s really hard to keep things apart. And then - in our desperation - we submit to the trial and error approach (the results of which usually fail in the next environment);-) ). So if we take support of elderly Windows systems including cross-compile environments like msys2/mingw serious, spaces unfortunately should be avoided.
A reasonable way of avoiding this problem would be that the interface
automatically replaces spaces with '_' when a file of BP is opened. This
is feasible on the PHP interface and I will implement it. Thus,
"-gr.notReich copy" would become "-gr.notReich_copy".
PHP/HTML are quite user-friendly (and international) with respect to
file names and links. They re-encode odd characters when necessary (such
as "%20" for a space). I am even using them with multibyte UTF codes
such as the Devanagari script.
> But then the "accessing csound" problem is not really something we/you have control over, so I guess when it appears - like in that script, one needs to hunt for a local solution. Note that this only happens, because I am running bp3 in a non-native console. In a modern “Dosbox” I could’ve queried the csound path with “where” and the path (including spaces) would have been passed over properly to the system. But alas, the Dosbox doesn’t understand the bash-script - so for now no automatic testing in really native Windows (cmake might be a solution at the price of another language, but that introduces another dependency and doesn’t support old systems). A nice aspect about using something like PHP is that they do “cross platform” as a fundamental requirement - so while I don’t have concrete knowledge about this yet - I would bet PHP (maybe actually Apache) solves all these problems for you - at the price of a different language - and I guess - another “command line syntax”.
Yes. When jumping to page "produce.php", arguments are send in $_GET
format (visible on the URL) and could as well be sent via $_POST. Then
the page takes care of building the appropriate command line.
> Btw., I am kind of surprised that you can do so much with binaries from PHP - generally - for security reasons - browsers are very restrictive in what they allow to happen on a local system (imagine somebody formatting the system disk when you press a button on a php-site - after all you don’t see what happens). I will try to understand better this weekend or next week.
This we had discussed earlier. We are running this PHP interface on
local web service (such as MAMP). For this reason calling "system"
commands also accept calling binaries. If we want to expose this
interface to the public we'll need a dedicated hosting with permission
to do the same. Practically it should be restricted to identified users
so that robots and hackers don't blow processor time and RAM space.
My suggestion is to install a Wordpress site from which only identified
users with some level of permission will be able to access the pages
from which BP commands can be issued. Their "material" (grammars,
alphabet etc.) would be stored in posts. I am quite conversant with
Wordpress + PHP environments after developing these tools:
https://lebonheurestpossible.org/pid-management/
https://lebonheurestpossible.org/revision-tracker-en/
If the "produce.php" page is in the Wordpress folder it can
automatically check the status of a connected user and accept or deny
access.
The host of my websites (OVH) said that they cannot grant me with such
features unless I take a "dedicated account" — indeed more expensive.
>> (Indeed I could search for the answer but it's easier to try!) When I do experiments on a grammar I create a copy of it, which means "-gr.NotReich" will become "-gr.NotReich copy" on the Mac.
> Yes, stuff like that could drive the parser mad;-) Not only that you start the filename with the “argument marker” - when it’s gotten past that hurdle, you add to its confusion with a space that is not a separation marker. I am sure Anthony loves this challenge of a totally non-conventional approach. It has something of a “really rare steak” - some love it, others shudder;-)
This he solved elegantly: if the grammar is "-gr.NotReich" he reads
"-gr" as the argument maker. If the name is different, for instance
"NotReich.bpgr" then we use the command "-gr NotReich.bpgr". This allows
more complex paths and dealing with spaces such as:
/Applications/MAMP/htdocs/bolprocessor/bp produce -gr
"/Applications/MAMP/htdocs/bolprocessor/ctests/-gr.NotReich copy"
In the end, command lines become very long because of the use of
absolute paths (starting with /Applications...), but these lines are
displayed at the top of the page on which they are executed. This
facilitates debugging.
>> I also like very much your submissions of PHP files to GitHub. PHP gives immediate results and I don't spend time documenting changes, with the risk of forgetting some worthy material in an older version. For instance, useful to see the updates in the reformat_grammar() command:
>> https://github.com/bagong/bolprocessor/commit/489ccd57554ebebdbbfc6faeed393c6a7b5b3349#diff-e1f470c90e7b480908538e55dd6ecfcd
> I am glad you appreciate it! I wasn’t sure if you minded the public exposure of early code, or even thought that I am running away with something - which of course is not the case. It just helps me doing testing in an environment that I am used to, and who knows - if someone saw it on Github, he/she might get interested in contributing to the project.
Yes, this might happen. Much like I believe there exist exoplanets
peopled with intelligent and gentle aliens, my theory is that there are
a few "Anthony Kozars" flying in cyberspace for the team to grow :-)
After all, you are one of them, with specific experience and expectations!
> I did hope that you'd appreciate the aspect of documenting code-development by “freezing” stages in commits. A git-repo is really another window into history. And if the commit-messages are expressive, they can tell the story of the project. And diffs with a button are so cool to. Really the relation of Github to git is somewhat like the relation of bp-php to bpconsole. The ability to create diffs is built into the binary, and Github just calls the functionality (I imagine ;-)). That is maybe an interesting analogy when thinking about how responsibilities are shared between yours and Anthony's work (I remember that “reinventing the wheel” sentence).
>
> But coming back to commits: I am happy to add your snapshots as commits to the repo to create sort of a history of code development. That would not only be interesting, but maybe also helpful if regressions occur or one needs to find out why something went wrong in the past (I think it’s called “disecting” in git lingo). But as I don’t really understand what you’re doing - and as I depend on your little descriptions of your changes for the commit-messages, the usefulness will be the bigger, the more detailed you describe, what individual snapshots do. If I just look if there is a new snapshot on your download-site every day or week, I can update the Github repo - but I wouldn’t really be able to tell what the innovations of each snapshot were….
Right. Now that I know all major changes will be recorded in the Git
repository, I will take care of describing modifications and pointing at
the implementation of new features. Bug fixes are less interesting
although sometimes they reveal the misunderstanding of procedures and
algorithms. (For example, should we do "mkdir" in PHP or as a system
command?)
> But tbh - I am sneekily trying to convince you to use git yourself;-)
I will certainly end up doing the commits myself. I always feel lazy
learning new procedures, so I work intensively on one at a time. I spent
2 months designing a "history tracing" of Wordpress pages
(https://lebonheurestpossible.org/revision-tracker-en/) — actually using
string algorithms I was fond of when starting the BP project — in order
to display only relevant changes. But this made me versed in
Wordpress/PHP interactions (keeping protection plugins silent).
> If one keeps it simple, it’s almost banal to use, one just needs to keep remembering to commit. After the warmup-period to the “different world” that becomes second nature.
I am sure it will!
> Yes, it’s nice to work in different fields with a common goal, and
> it’s so lovely that Anthony likes to do this kind of work. Anthony is
> a star! Git actually also helps to undo accidental change and helps to
> reduce anxieties if people reach out into the “others” domain ;-) -
> especially if people are well minded and friendly - another aspect why
> you are so lucky to have found Anthony. But then I guess nice natures
> are bound to find each other at some point ;-)
The link is our common understanding of the program's operation at a
mature stage (in 1998), and I guess part of his initial motivation was
the possibility of dealing with Csound scores and instruments. Because
of complimentary experience we covered already a wide range of "visions
of music". We have enough in common to reach a consensus when issues are
discussed. Much like Harm Visser's interest was in polyrhythmic
structures and tools for creating a kind of serial music. Everyday he
would blow the application's RAM using recursive rules. This took me to
the idea of quantization.
The musical experience that is still missing in Bol Processor is that of
jazz music. Once we get feedback from jazz musicians we'll have more
ideas about "collective improvization" with several BPs joining the "band".
Sometimes I dream seeing things like this:
https://arcopypaste.app/ :-)
Designed by a young French student!
Bernard Bel
|