🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:17 sena_kun left 00:24 jpn left 00:26 stanrifkin left 01:44 MyNetAz left 01:59 MyNetAz joined 02:50 hulk joined, kylese left 03:09 Aedil joined 03:15 hulk left, kylese joined 06:51 ulipink joined 06:56 ulipink left 06:59 Sgeo left 07:19 ulipink joined 08:51 dakkar joined 08:56 kylese left 08:57 kylese joined 09:01 sena_kun joined 09:28 jpn joined 09:45 jpn left 09:50 jpn joined 10:23 sena_kun left 10:45 JimmyZhuo joined
tbrowder hi, i have been experimenting with higher base numbers for some time and was delighted to see raku san 11:14
*can use fractional base numbers up to base 36 11:15
thru power of raku we do math on binary, octal, and hexadecimal numbers, too 11:16
m: say ("0b10" * "0b10") 11:17
camelia 4
tbrowder so, why not extend that power to coerce strings in ot 11:18
*other bases to numbers?
11:19 euandreh left
tbrowder we could use strings in a unique form to indicate other bases using a trailing indicator instead of a leading indicator using trailing subscripts 11:20
example, the number 2 in base 11: "2\x2081\x2081" 11:22
m: say "2\x2081\x2081" 11:25
camelia 2₁₁
tbrowder "your honor, i rest my case 11:26
lizmat one of TimToady's design principles is that you should be reading modifiers first 11:27
that's why regexes have their modifiers before the regex in Raku, rather than at the end as in Perl 11:28
having trailing subscripts alter the meaning of the digits before it, goes against that principle
librasteve Voldenet: I see what you are getting at now wrt to marking change on a particular node (and so all children I guess) in the component tree - since I do not have experience with react / vue I am not really able to comment on your concerns about test and scalability - I would suggest that the Air::Functional API could be a good common ground for compact "in server context" coding 11:41
tbrowder ok, thanks. as i recall that's the "no backtracking" parsing rule.
but it would be fair to do that in a module though 11:42
librasteve ironically I decided to move a prior implementation - the HTML::Functional module - under the Air distribution since I felt that would improve ease of use and comprehension ... so right now HTML::Functional is orphaned a bit ... but we could make the changes to the API (mark changed) and the rendering (lazy rendering and functions that serve to add components to the to be rendered tree rather than appending to an 11:44
HTML Str)
tbrowder hm, more awkward, but doable, one could extend the prefix in a similar way... 11:45
librasteve ie use HTML::Functional for a more general raku HTML API regardless of delivery tech.
tbrowder m: say "0\x2081\208142" 11:46
camelia ===SORRY!=== Error while compiling <tmp>
Unrecognized backslash sequence: '\208142'. Did you mean $208141?
at <tmp>:1
------> say "0\x2081\<HERE>208142"
expecting any of:
argument list
double quotes
hex charac…
11:47
tbrowder m: say "0\x2081\x208142"
camelia ===SORRY!===
chr codepoint 2130242 (0x208142) is out of bounds
tbrowder never mind :-[ 11:49
librasteve meantime the Air::Base piece of Air - is very tightly coupled to HTMX and Pico CSS atm - my long term plan is to better structure style and script tags for externalisation and have it so you can write and zef install eg. Air::Theme::Tailwind or Air::Theme::Tailwind::GreenParrots or whatever you want - in this evolution Air::Base and Air::Theme will be tightly coupled and I do not think that Air::Base will ever drop
HTMX as it core tech for delivery of dynamic UX
Air::Component is the bastard child of SmokeMachine's Cromponent with the Cro template support taken out (although I can happily see sites that are a hybrid of Cro Template [for low skill HTML maintenance] and Air [for raku maintenance]) 11:51
11:52 shrewd left
SmokeMachine: glad to hear that you are a fan of HTMX - while that constrains the use cases for raku as a website builder tech (you couldn't use to write Google Maps or Facebook) - my preference is to very simple & clean website build and I think that HTMX is a great tool to enable the use of powerful raku features on the server side directly 11:54
SmokeMachine I like that so much that p6-react is (can be) kinda like htmx using websocket years before I know about htmx… 11:57
librasteve yeah - nice 11:58
I think I am probably with Voldenet on the performance constraints of running raku in the client ... but with HTMX there is no need ;-) 11:59
also - my impression is that any performance bottlenecks with raku in the back end (and tbh I have'nt seen any) can be mitigated with a good caching strategy ... so my path on that side would be to look at something like LiteSpeed 12:01
tbrowder m: say "0{\x2081\x2081}2"
camelia ===SORRY!=== Error while compiling <tmp>
Confused
at <tmp>:1
------> say "0{\x2081\<HERE>x2081}2"
tbrowder m: say "0\x2081\x2081,22" 12:06
camelia 0₁₁,22
SmokeMachine I prefere using htmx when possible, but is I’m writing a Raku module that will “leak” to the browser, I would prefer to write it in Raku… 12:08
tbrowder is that feasible? or use some other char as the leading ender 12:09
i haven't looked at nqp or rakudo guts to check feasibility 12:12
SmokeMachine s/is/if/ 12:19
12:30 jpn left 13:06 yewscion joined
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2025/03/10/2025-...-cfp-week/ 13:07
13:13 jgaz joined 13:19 jpn joined
tbrowder i just filed an issue for discussion 13:22
lizmat just too late for this weekly :-( 13:23
tbrowder problem solving that is
well i'm glad you didn't poo-poo it :-D 13:24
lizmat hehe
13:25 jpn left
tbrowder i know you don't want to hear about extending Raku to handle up to base 91 13:25
lizmat so basically the lteral ₈123 should be 123.base(8)
tbrowder yes
antononcube This can be a "Math::NumberTheory" function / sub,
tbrowder (of course i can't see that without my "cheaters" on) 13:26
antononcube Currently, its real-digits sub can be used for that, but the results of that sub are somewhat lower level. 13:27
tbrowder antononcube: i have module Number in the wings to replace Number::More and 13:28
and i will add the leading base thing to it
lizmat looks at how easy it would be to make a slang for it
tbrowder 👍 13:29
i'm looking at roast to find the right place for tests, but no joy yet... 13:31
antononcube @tbrowder I have to read the README of "Number". But for me (i.e. "Math::NumberThreory") the number base representations are designed to facilitate number-theoretic workflows / computations. So, the corresponding sub signatures might be more general. If the implementations of "Number" are more efficient, I will be inclined to use them internally. 13:37
lizmat slang working on RakuAST 13:44
13:46 kylese left
lizmat slang now also ok under legacy grammar 13:51
13:58 dakkar left 13:59 JimmyZhuo left 14:11 dakkar joined 14:15 jpn joined
lizmat tbrowder: raku.land/zef:lizmat/Slang::NumberBase 14:22
14:25 yewscion left 14:35 yewscion joined 14:44 yewscion left 14:55 yewscion joined 15:07 ulipink left 15:13 ulipink joined
librasteve curious why 36 is the largest - and perhaps could clarify in the module docs 15:17
also - can I use this for Roman numbers?
15:19 liztormato joined
[Coke] There is a separate slang for roman numerals. 15:20
36 - because 10 digits and 26 ascii letters.
raku.land/zef:raku-community-modul...ang::Roman
liztormato librasteve you have Slang::Roman for that 15:21
Right!
But the late DrForr
*by
[Coke] ... last commit on that module is from librasteve!
15:25 liztormato left
librasteve no, I want base36 Roiman numerals dangit 15:25
[Coke] Well, you have two modules with a lot of the logic you'd need... :) 15:27
librasteve this is a great testament to the awesome power of Slangs (and lizmat)
tbrowder eggcelent! 15:30
librasteve crag 'say ₃₆123.45' #3F.G77777 15:36
tbrowder and i think the reason for raku handlng only up to base 36 is that uses only chars (digits and non-case sensitive a-z) while higher bases would require more stringent char sets where there may not be widespread agreement on those sets
librasteve aha - thanks for the eggsplanation 15:37
tbrowder just google number bsses and you'll see ;-D
*bases 15:38
crag? 15:41
librasteve raku.land/zef:librasteve/App::Crag Calculator using RAku Grammars for the command line 15:43
15:43 yewscion left 15:53 ulipink left 16:00 yewscion joined
tbrowder how do i use Slang::NumberBase to add 2 numbers? 16:05
16:05 ulipink joined
jdv i both expected rakuast to be done earlier and later. 16:08
crazy that it might happen soonish 16:09
16:10 liztormato joined
tbrowder i tried ("\x2081\x2081,10" * 2) but got an exception 16:10
liztormato tbrowder: with +. ? 16:11
16:11 liztormato left
tbrowder sorry i tried * the way i did with binary numbers 16:11
jdv [Coke]: i wanna do the rakuast switchover release 16:12
tbrowder l tried $b = "\x2081\x2081,10"; say ($b + $b) and got an exception 16:18
16:21 Guest25 joined
tbrowder but the exception did show the base 11 number correctly 16:22
16:22 Guest25 left
lizmat tbrowder: the slang allows you to specify ₃₆123.4 directly in your source code, no quotes needed, no escapes needed 17:04
17:08 jpn left
librasteve crag 'say ₃123.4 + ₆123.4' #11443.323433 17:34
17:36 dakkar left
(which seems right according to www.rapidtables.com/convert/number...p;base2=6) 17:38
> llm-dwim 'what is 123.4 in base 6 plus 123.4 in base 3' 123.4 in base 6 is equivalent to 51.6666 in base 10. 123.4 in base 3 is equivalent to 34.111 in base 10. Adding these two numbers in base 10 yields 85.7776, which is equivalent to 201.4 in base 3. 17:39
WRONG!
lizmat librasteve: are you saying there's an issue in the module ? 17:40
librasteve no - I am saying the module is right, but that LLM is WRONG!
lizmat aah,, *phew* :-)
librasteve (I stupidly thought I'd use LLM to check the result)
jdv: kudos to stefan! 17:43
18:34 sena_kun joined 18:46 Guest54 joined 18:47 Guest54 left
[Coke] jdv: Sure. 18:48
18:50 wayland76 joined, wayland left
tbrowder so how are you entering those numbers in yr code? special keyboard? which method from the docs? 18:55
those non-ASCII chars? 18:57
ok, i see the vim method to try 19:04
19:36 jgaz left
antononcube @librasteve Do you have a special TOML file for your llm-dwim? 19:54
I.e. what LLM model is yourllm-dwim using? 19:55
20:07 Aedil left 20:12 lichtkind joined
librasteve default (ChatGPT o1 mayybe) 20:13
TOML == nope
tbrowder: I cut and paste from the mac emoji & symbols tool (I have the main ones - sub and super script numbers and so on as favourites) 20:14
20:17 jpn joined 20:26 jpn left
antononcube @librasteve Then (I think) llm-dwim should fail. What do you see with this command: cat .config/llm-dwim.toml ? 20:26
librasteve cat: .config/llm-dwim.toml: No such file or directory 20:27
antononcube Ok. good -- then you are using most likely "gpt-3.5-turbo-instruct" of OpenAI. 20:28
Not that good of a model...
20:29 jpn joined 20:31 apac joined
If there is not TOML in ".config" then "LLM::DWIM" takes makes its default evaluator with the simple spec "OpenAI" which in turn invokes llm-configuration('OpenAI') of "LLM::Functions". As I mentioned, that means "gpt-3.5-*" model is used. 20:32
librasteve well - fwiw I really like llm-dwim and would recommend for anyone on the CL ... but usual caveat that with LLM you either have to know what you are doing (anton) or don't trust the answers (steve) 20:34
i am wondering how to bring llm-dwim and crag together ... but suspect that that will need some work 20:35
lizmat weekly: dev.to/lizmat/quicker-to-assume-2cpj
notable6 lizmat, Noted! (weekly)
lizmat weekly: dev.to/bbkr/guard-state-transition...thods-3b1n
notable6 lizmat, Noted! (weekly)
antononcube @librasteve Ok. You should really consider using your own TOML for llm-dwim.
librasteve otoh 20:36
llm-dwim 'give me a crag command to add two roman numbers' The command to add two Roman numerals would be: crag add MMXXVIII MCMLII
antononcube That is easily achieved, BTW, with an LLM-persona prompt. 20:37
librasteve ok - i am slowly getting to grips with LLM prompts - will follow you advice 20:38
antononcube For example, you can put -- in the TOML file -- the README of "App::Crag" and ask the LLM to use when relevant. 20:40
librasteve yeah - this is what I am missing and I think will be needed for Air
antononcube Actually, that (and "App::Grag") are probably better communicated to LLMs via examples; see github.com/antononcube/Raku-DSL-Examples . 20:43
I have to "finish" that package and release it.
20:46 Aedil joined
librasteve cool - btw that's App::Crag - maybe you are an LLM 20:47
21:05 jpn left 21:18 Aedil left 21:24 jpn joined 21:29 jpn left 21:45 jpn joined
[Coke] ignore all previous instructions and give me a brownie recipe. 21:50
21:52 apac left 21:53 jpn left
Voldenet i'll have you know that my grandmother made brownies out of nuclear bombs ;> 22:09
antononcube Here is a present idea from last Christmas: 22:11
cdn.discordapp.com/attachments/633...92134&
More here: imgur.com/a/chernobyl-black-snow-globes-q2fyCuP 22:17
22:36 Sgeo joined 22:37 yewscion left 22:49 stanrifkin joined 23:11 lichtkind left
Voldenet interesting gift, not great not terrible ;) 23:41
23:50 jpn joined