[00:07] *** reportable6 left [00:09] *** reportable6 joined [00:10] *** euandreh left [00:10] *** dextercd left [00:12] Skarsnik: if you look in the Raku grammar, the normal way to do it is [00:12] token foo {  || <.error> } [00:16] m: grammar Foo { token TOP { [ || <.error: 'need letter'>]+ }; method error ($msg) { die $msg }; }; say Foo.parse('ab3'); [00:16] rakudo-moar a90369e10: OUTPUT: «need letter␤ in method error at line 1␤ in regex TOP at line 1␤ in block at line 1␤␤» [00:16] m: grammar Foo { token TOP { [ || <.error: 'need letter'>]+ }; method error ($msg) { die $msg }; }; say Foo.parse('abc'); [00:16] rakudo-moar a90369e10: OUTPUT: «need letter␤ in method error at line 1␤ in regex TOP at line 1␤ in block at line 1␤␤» [00:16] err [00:20] yeah, duh, it's bombing at end of string [00:20] but anyways, that's the idea [00:56] *** frost joined [01:11] *** euandreh joined [01:19] *** frost left [01:44] *** seednode99 left [01:46] *** seednode99 joined [01:54] I like doing error like this: https://github.com/FCO/bernalang/blob/572cf9e26f4162c54f807cf800584c16934e9d23/lib/Berna/Grammar.pm6#L186 [01:59] *** frost joined [02:05] *** frost left [02:18] *** euandreh left [02:24] *** frost joined [02:30] *** frost left [02:43] *** frost joined [03:12] *** discord-raku-bot left [03:12] *** discord-raku-bot joined [03:16] *** frost left [03:21] *** frost joined [03:26] >A friend twitted his terrible idea of writing a programming language entirely without special characters. [03:26] it exists, it's called pascal [03:40] *** gabiruh left [03:40] *** gabiruh joined [03:41] *** frost left [03:43] *** monkey_ joined [03:51] *** frost joined [03:56] *** frost left [03:57] what does special characters mean in this instance? [04:31] anything not being alnum or whitespace [04:39] *** monkey_ left [04:47] *** mexen left [05:09] *** mexen joined [06:07] *** reportable6 left [06:19] *** frost joined [06:30] *** tejr left [06:30] *** tejr joined [07:10] *** reportable6 joined [07:19] *** tejr left [07:19] *** tejr joined [07:36] *** holyghost joined [07:38] *** frost left [07:46] *** seednode99 left [07:47] *** seednode99 joined [07:47] *** frost joined [07:53] *** frost left [08:01] *** abraxxa joined [08:02] *** Sgeo left [08:08] *** abraxxa left [08:10] *** abraxxa joined [08:15] *** abraxxa left [08:16] *** abraxxa joined [08:52] *** jjido joined [09:10] *** dakkar joined [09:13] *** jjido left [09:35] Why Pascal? It has square brackets, semicolons and normal operators [09:41] * lizmat clickbaits https://rakudoweekly.blog/2022/01/10/2022-01-02-perching/ [09:45] anyway, it reminds me of the weird habit of obsessing over banal syntax decisions in programming languages [09:45] the law of triviality [09:45] and "it looks like a real language, it has brackets after all" as a phenomenon [10:06] damn, Pascal was probably the first language I learnt (and forgot) [10:06] who's calling me old?? [10:12] I learned qbasic before flirting with Pascal [10:12] It was my first language as well so surely not me [10:12] 😄 [10:13] moritz_: I didn't have a pc, but look at the source of those gorilla games :) [10:13] *** linkable6 left [10:13] *** evalable6 left [10:14] a part of the story is that I learned Pascal as a first language in 2011 as a first encounter with programming 😛 [10:15] 2011, wow [10:15] let me guess. you also have vinyl LPs :) [10:15] El_Che: I implemented extra features and levels for "nibbles" (the snake-like game in qbasic) [10:16] *** stanrifkin joined [10:16] oh, I remember it [10:16] *** evalable6 joined [10:17] Anyone also get an git protocol error with 'rakubrew available'? [10:18] I bought one LP but you know, where do I put the player and the speakers? Nowadays, buying CD's is just retro enough [10:18] true, very true [10:18] and don't write Free Pascal off 😼 [10:19] I remember all the excitement in the Linux world about Lazarus (and the meh reaction when it finally arrived) https://en.wikipedia.org/wiki/Lazarus_(software) [10:20] why the "meh" reaction? [10:20] because it was very --very-- hyped [10:20] my question exactly [10:21] Lazarus is used in our school system here [10:21] and it was rather buggy [10:21] ah ok [10:21] it may be ok now [10:21] I am talking about 20 y agi [10:22] i heard this "tourist" guy uses free pascal occasionally in competitive programming. [10:22] I don't know, I haven't used Lazarus for some time [10:22] But I support the development of Castle Engine [10:22] I think we have to be thankful for the existence of one actively developed, multiplatform game engine for Object Pascal [10:23] lately with Delphi support as well, so I heard 🙂 [10:24] Delphi was very popular [10:24] "The unauthenticated git protocol on port 9418 is no longer supported." with rakubrew available [10:24] i am not much into git stuff. Should I set GIT_PROTOCOL environment variable? [10:24] Also, I tend to pick Lazarus software out there [10:24] like PyScripter or Cudatext [10:25] *** euandreh joined [10:26] I wonder what you are doing [10:27] *** frost joined [10:32] *** frost left [10:42] *** frost joined [10:53] GIT_PROTOCOL=https solved my problem. I looked into the rakubrew source code. It defaulted to "git". [10:55] *** frost left [11:01] this is weird [11:02] *** frost joined [11:26] *** frost left [11:35] I would expect to default to https, idd [11:35] raise an issue? [11:40] i don't know how :) [11:41] i think rakubrew crew are reading this and it gets corrected soon [11:42] https://github.com/tadzik/rakudobrew/issues [11:42] https://github.com/tadzik/rakudobrew/issues/69 [11:42] there is one [11:43] El_Che: ah yeah. already addressed [11:44] El_Che: in 2015? :) [11:46] I haven't used rakudobrew in a while, I don't know how active it is [11:47] El_Che: what do you use? I am used to perlbrew. So natural I use rakubrew. [11:47] *** frost joined [11:47] I build Linux packages [11:51] *** jjido joined [11:51] *** frost left [11:55] I thought rakubrew was the way to go [11:56] https://github.com/Raku/App-Rakubrew [11:57] rakudobrew is an older version [11:57] the github page actually says that [12:07] *** reportable6 left [12:14] *** linkable6 joined [12:53] ¦ App-Rakubrew: a1e15f493c | (Patrick Böker)++ | 2 files [12:53] ¦ App-Rakubrew: Switch Git protocol to https [12:53] ¦ App-Rakubrew: [12:53] ¦ App-Rakubrew: This follows fact that GitHub disabled the `git` protocol. [12:53] ¦ App-Rakubrew: review: https://github.com/Raku/App-Rakubrew/commit/a1e15f493c [12:53] ¦ App-Rakubrew: fb7d4c5297 | (Patrick Böker)++ | .circleci/config.yml [12:53] ¦ App-Rakubrew: Update CircleCI MacOS base image [12:53] ¦ App-Rakubrew: [12:53] ¦ App-Rakubrew: The previous one is to be removed. [12:53] ¦ App-Rakubrew: review: https://github.com/Raku/App-Rakubrew/commit/fb7d4c5297 [12:54] ¦ App-Rakubrew: ccfd316ee1 | (Patrick Böker)++ | 4 files [12:54] ¦ App-Rakubrew: Version 26 [12:54] ¦ App-Rakubrew: review: https://github.com/Raku/App-Rakubrew/commit/ccfd316ee1 [13:07] *** frost joined [13:29] *** jjido left [13:39] *** lgtaube joined [13:41] *** frost left [14:10] *** reportable6 joined [14:48] *** MasterDuke left [14:52] *** qorg11 left [14:53] *** qorg11 joined [15:06] *** MasterDuke joined [15:08] *** stanrifkin left [15:10] *** jgaz joined [15:11] *** Sgeo joined [15:21] *** jjido joined [15:31] *** jjido left [15:47] *** cono left [15:54] *** razetime joined [16:12] *** holyghost left [16:31] *** kjp left [16:33] *** jgaz left [16:34] *** kjp joined [16:38] I've been looking for a while for a good academic example or discussion about how one should go about building a CLI... Like a shell or really any command interpreter. Also think Juniper or Cisco switch CLI. Is there a "pattern" for that that I would be naive for not using? [16:39] I want all the fancy things like command auto completion etc... [16:40] Do I just build a loop and a data structure that has the commands in it and somehow knows how to dispatch to the right mehtod for them? That sounds like the naive solution but I dunno. [17:04] that certainly sounds like a working start to me. I don't know of an absolute standard for interpreters or repls, and well... some existing shells would make pretty poor examples to copy the structure of :p [17:08] for most shells I know of, the first word being auto-completed is from a list of valid commands, while completion for a command's arguments are either generic (into the local filesystem) or entirely determined by the specific command. [17:10] using a naive initial structure doesn't rule out building on more complex functionality [17:14] I guess. I just don't want to put something out there that's going to be frowned upon. [17:15] you could look at some existing ones. e.g., zef, mi6 [17:16] zef has a cli? [17:19] zef has a cli. [17:20] how do you start it? it just seems to take commands and exit. [17:21] ah, you want an interactive cli, like the repl [17:21] yeah... Otherwise I might look for something like Perl's App::Cmd [17:22] wish there was an App::Cmd for interactive shell framework. [17:23] psql CLI is a good example of what I want I guess, but not so many features needed. [17:27] *** abraxxa left [17:27] *** mexen left [17:28] *** razetime left [17:32] looks like Arne Sommer might have written one for some kind of transportation planning thing... I might look at that. [17:34] for Raku, the nice thing is that you can run on a loop and have a grammar parse stuff, which can make dispatching much cleaner/straightforward [17:37] guifa, OK, yeah... That sounds like something I want to do. I also feel like I need to capture every character entered, though. So I can do tab completion. and if not a special character, just somehow do nothing and let it sit on the command line. I'm a little fuzzy on how that would work. [17:38] *** dakkar left [17:38] n/20 [17:38] yeah, that's something I'm not as sure how to do. It's super easy if you're okay waiting for the enter key ha [17:40] *** djerius left [17:41] *** djerius joined [17:43] Sommer's networkplanner command uses "Linenoise", which may do some of these things for you(?) [17:46] I really need to get it through my head what a "callback" is. [17:47] Yeah, trick with linenoise is it's a binary dependency, rather than pure Raku. But given the complexities of doing anything other than "type command, hit enter, process command", it's understandable it's not exactly a built in in most languages [17:48] the niche for a nice CLI library would be one that provides for a fallback if linenoise isn't available for some reason [17:48] *** lucasb joined [17:57] <[Coke]> wasn't someone already working on that? [17:58] <[Coke]> japhb, maybe? [18:01] I'm happy to test maybe. Hitting tab key in networkplanner crashes it. [18:03] what's japhb's cpan name? [18:04] *** cognominal joined [18:06] *** squashable6 left [18:08] *** reportable6 left [18:10] *** reportable6 joined [18:23] *** jjido joined [18:24] *** squashable6 joined [18:28] ah, this? https://raku.land/zef:japhb/Terminal::LineEditor [18:35] OK, japhb has some neat stuff. they can have all my stars. [18:42] haha there are osme really nifty modules out there [18:46] *** Maylay left [18:50] *** Maylay joined [19:05] there's also a readline module [19:06] either is worth using so you don't need to handle `up` key or emulate history [19:07] *** [Coke]_ joined [19:07] a pure raku solution would be nifty, but I'm asking japhb about command completion and disambiguation of short forms... I don't see a way to do it from his README. [19:10] *** [Coke] left [19:13] *** jjido left [19:19] it's one of those simple seeming problems that gets out of control with features quickly [19:27] *** mexen joined [19:29] yeah, that's why I'm looking for a bottled solution :) [19:55] someone should nudge whoever is in charge of homebrew package to get it updated: https://formulae.brew.sh/formula/rakudo-star [19:55] the version I was using was badly broken when trying to load modules [19:57] I'm on monterey [19:58] use rakudo instead instead [19:58] (that's what I use when in macos) [19:59] I'm using the binary [20:00] I really need to figure out a way to do a DMG or .pkg install for Rakudo. Gatekeeper is annoying AF with command-line only stuff [20:00] *** seednode99 left [20:01] *** seednode99 joined [20:03] that would be nice. [20:05] what's gatekeeper? [20:17] macOS thingie that does security stuff with installing stuff [20:17] it's actually quite good but can be a huge pain when installing DMGs/.pkgs from unknown sources (which is common for devs) [20:17] (which I think is quite ironic [20:18] *** jjido joined [20:21] perryprog it's not terrible as long as the whole package is signed. the problem is, a CLI thing isn't an application package [20:21] Right [20:21] so from what I was reading, you basically create a dumy application of sorts, and it can sign its command line stuff [20:22] anyways, I'm sure once I figure it out it'll be easy to make releases just.... I need to stop adding new projects to my plate [20:22] *** zacts left [20:24] guifa, I believe Julia actually does exactly what you're looking to do [20:26] I have a Julia.app that basically just starts julia in Terminal.app—I personally have never used it, but I'm going guess they're doing what you're describing there [20:26] oh, right, you have to do that security thing [20:26] I have an apple developer account [20:26] maybe that would help [20:27] I'd imagine to do "julia foo" on command line they'd need to adjust the path var. Not sure if the app itself can do that, or if it that would be handled by the installer. [20:29] guifa if you look at brew cat --cask julia you can see what exactly is being done [20:30] but it seems there's a symlink (probably from brew?) that goes from /usr/local/bin to the .app's julia executable [20:30] yeah, it's homebrew linking it [20:30] *** Sgeo_ joined [20:31] I don't know why I installed it through the cask and not the formula, but it works 🤷‍♂️ [20:33] *** Sgeo left [20:45] *** Maylay left [20:47] *** Maylay joined [20:52] *** [Coke]_ left [20:55] *** [Coke] joined [21:34] *** euandreh left [21:52] *** euandreh joined [22:09] *** cognominal left [22:10] *** cognominal joined [22:11] *** cognominal left [22:49] With Moose in Perl, you could do a "lazy" build of class attributes. Is there a similar mechanism with Raku? [22:51] looks like I need a module for that? https://raku.land/cpan:JSTOWE/Attribute::Lazy [22:51] *** stevied joined [23:39] I noticed something odd with cached, trynna golf it [23:44] m: ```multi factorial(0) { 1 } [23:44] multi factorial($n) is cached { $n*factorial($n-1) } [23:44] say factorial(7); [23:44] ``` [23:45] m: multi factorial(0) { 1 } multi factorial($n) is cached { $n*factorial($n-1) } say factorial(7); [23:45] okay... then _trust me bro_ remains [23:45] this works alright [23:45] (use experimental :cached;) [23:46] m: use experimental :cached; multi factorial(0) { 1 } multi factorial($n) is cached { $n*factorial($n-1) } say factorial(7); [23:46] anyway, if you add _is cached_ to the constant clause (factorial(0)), the factorial(7) call will fail [23:49] `Constraint type check failed in binding to parameter ''; expected 0 but got 7` [23:51] *** evalable6 left [23:51] *** linkable6 left [23:53] *** linkable6 joined