š¦ Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
00:01
DiffieHellman left,
tejr left,
xelxebar left,
asymptotically left
|
|||
sampersand | makes sense | 00:01 | |
let me try to explain it so you dont have to read it through | |||
So to learn new programming languages, i implement this dumb little language I've dubbed `Knight` . I've designed the language spec in such a way that it's easy to implement the language in anything i want. | 00:03 | ||
00:03
xelxebar joined
|
|||
summerisle | sampersand: are there samples anywhere? | 00:03 | |
sampersand | So, in Raku, I thought it might be cool to do it with grammar | ||
yeah, i have it implemented in about a half dozen languages by now | |||
00:04
clarjon1 joined
|
|||
summerisle | i want to make a lisp-like language that spits out qast to mix with raku | 00:04 | |
00:04
DiffieHellman joined
|
|||
sampersand | <github.com/sampersand/knight/tree/raku> the C, haskell, perl, php, python, ruby, rust, AWK, and posix-compliant SH examples all work | 00:04 | |
with the asm, raku, and quest versions each almost done. | |||
00:05
asymptotically joined
00:06
tejr joined
|
|||
sampersand | i want to finish the raku version this weekend, complete with comments. (I have only commented the C, php, and perl impls so far...) | 00:07 | |
though of the languages ive explored so far, raku's my favourite and the one ill probably continue after my quest is over | 00:08 | ||
00:21
guifa2 left
00:22
wamba left,
guifa2 joined
00:29
monkey__ left,
monkey__ joined
|
|||
Doc_Holliwood | How do we handle this? medium.com/@alex.birsan/dependency...5d60fec610 | 00:36 | |
Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies | |||
summerisle | i know Zef has to run a build step for native stuff. i suppose that step could be as isolated as possible using something like bwrap on linux, whatever on bsd, etc... | 00:39 | |
seeing as the build would need access to system dependencies for headers, libraries, and tooling | 00:40 | ||
01:06
Doc_Holliwood left
01:12
monkey__ left
01:20
mowcat left
|
|||
guifa2 | .tell Doc_Holliwood we had actually been talking about that for a while. The main thing is ensuring that people use :auth<foo>. IIRC, zef already will only use a github source owned by github user foobar given :auth<git:foobar> | 01:33 | |
tellable6 | guifa2, I'll pass your message to Doc_Holliwood | ||
guifa2 | local libraries via (use 'lib') are also always preferred over. But ugexe is definitely the expert on the topic | 01:35 | |
01:37
sortiz joined
01:38
pecastro left
01:43
monkey__ joined
01:52
gnufr33dom left
01:53
monkey__ left
02:12
DiffieHellman left,
DiffieHellman joined
|
|||
sampersand | ok so ive been hacking at this on my own for a while | 02:14 | |
but i still cant completely crack it | 02:15 | ||
so, i have a role `Value`, which everything in Knight implementsānumbers, functions, identifiers, strings, everything. Every type has an "assign" method, but it simply convert that type to a string, then an identifier: `= (+ "__ast_" ast_level) 3` . As such, my `Value` type has a function called `assign`: `method assign(Value $value, --> Value) { | 02:18 | ||
Identifier.new($.Str).assign: $value }` . However, since `Identifier` `use`s `Value`, im getting a circular import | |||
any ideas? | |||
02:31
sampersand left
02:32
sortiz left
02:33
sampersand joined
02:45
rindolf joined
02:58
kvw_5 joined
02:59
sampersand left
03:01
kvw_5_ left
03:21
kst joined
03:42
gnufr33dom joined
04:04
aborazmeh joined
04:13
aborazmeh_ joined
04:14
aborazmeh left
04:41
aborazmeh_ left
04:58
pazitiff joined
05:13
angelds joined
05:14
pazitiff left
06:14
notable6 left,
unicodable6 left,
coverable6 left,
statisfiable6 left,
quotable6 left,
benchable6 left,
tellable6 left,
nativecallable6 left,
evalable6 left,
bisectable6 left,
greppable6 left,
releasable6 left,
linkable6 left,
sourceable6 left,
squashable6 left,
bloatable6 left,
shareable6 left,
committable6 left,
statisfiable6 joined,
notable6 joined,
bloatable6 joined
06:15
tellable6 joined,
linkable6 joined,
nativecallable6 joined,
releasable6 joined,
quotable6 joined,
shareable6 joined,
unicodable6 joined
06:16
bisectable6 joined,
sourceable6 joined,
squashable6 joined,
coverable6 joined,
evalable6 joined
06:17
committable6 joined,
benchable6 joined,
greppable6 joined
06:25
parabolize left
06:31
angelds left
06:37
_jrjsmrtn left,
__jrjsmrtn__ joined
|
|||
summerisle | pretty sure raku doesn't currently have import aliasing (without modifying EXPORT in the desired package), or am I missing something? | 06:43 | |
guifa2 | summerisle: correct. The author of the package would need to set up a way for things to be aliased | 06:46 | |
elcaro | summerisle: for a name that gets imported automatically, you can crete your own alias, but of course, the original name is still in your namespace | 06:52 | |
eg. my &slfn := &super-long-function-name; slfn('foo') | |||
guifa2 | ^^ yeah that's true, I figuerd he wanted to avoid the original and only have the custom one | 06:53 | |
elcaro | unfortunately, Raku makes it easier to for module writers to pollute the users namespace than do selective imports | 06:54 | |
my `Exportable` module attempts to make that easier | 06:56 | ||
ideally, `is export` should have made subs _available_ for import, and only exported by default when you do `is export(:DEFAULT)` | |||
interestingly, I believe this is how Damian's `Perl6::Export` module for perl5 does it | 06:58 | ||
guifa2 wishes that the `use` passed *both* positionals *and* named to the EXPORT sub. I think I could od some more interesting things there | |||
elcaro | I mentioned this last time this topic came up, but this is all things i complain-blogged about a couple years ago here: 0racle.info/articles/exportation_exploration | 06:59 | |
in that article, I also show a hackjob way of doing import aliasing (with the syntax `use Foo \[ foo => 'bar' ]; # imports &foo as &bar`) | 07:00 | ||
but the EXPORT sub needs to support it, of course | |||
as mentioned in the second part of that article, the "sane" way of supporting aliasing, is to have you subs `our` scoped, and import nothing by default | 07:05 | ||
summerisle | my question comes more from a place of concern about symbol fighting, e.g. if Foo::Bar has `sub frobnicate() is export` and so does Foo::Baz, and I need to include them both - it seems like there will either be some runtime error, or `use` order will become significant. | ||
elcaro | `module Foo { our sub bar { ... } }` can be imported as `use Foo; my &foobar := &Foo::bar; foobar(...)` | ||
summerisle | other than that, namespace pollution isn't a terrible concern if it's not obtrusive. | 07:06 | |
elcaro | yeah, it's a problem, but there are work-arounds | ||
since `use` is lexical, you can import inside a block, aliase to a name outside the block | |||
something like `my &foobaz-frob = do { use Foo::Baz; &frobnicate }` | 07:07 | ||
I think... the syntax is something like that | |||
summerisle | well, of course that works | ||
but it's still working around a language semantics issue | 07:08 | ||
albeit a somewhat theoretical one | |||
elcaro | well, yeah, at least there's a relatively simple work around. As mentioned, I really wish implicit exports weren't the path of least resistance... but I think the ship has sailed on any changes to that now | 07:09 | |
unless something like `is exportable` (similar to my module) is added to core, and strongly recommended by the community | 07:10 | ||
summerisle | i could see it happening | ||
i'd be more interested in matcher/grammar optimizations though - i should look at the guts for that | 07:11 | ||
elcaro | yes, when I said "ship has sailed" i mean, we can't change the semantics of `is export` now... it's too late, but we can offer a better alternative. it's do-able | ||
summerisle | has anyone done a writeup on nativecall overhead? i'd be interested in reading that | 07:14 | |
07:17
gnufr33dom left
07:21
ufobat__ left
|
|||
elcaro | NativeCall is a bit above my pay-grade. Never wrote C in my life | 07:23 | |
summerisle | big C fan here | 07:32 | |
07:32
asymptotically left,
asymptotically joined
08:12
aborazmeh joined
08:28
aborazmeh left
08:30
aborazmeh joined
08:32
robot joined,
robot is now known as Guest54755
08:34
Guest54755 left
08:42
guifa2 left
08:52
aluaces joined
09:18
Garbanzo left
09:38
aborazmeh left
10:02
MasterDuke joined
10:23
Discipulus joined
10:36
camelia joined
10:37
leah2 left
10:44
guifa2 joined
10:45
guifa2 left
10:49
leah2 joined
10:56
camelia left
11:02
nine_ joined,
nine_ left
11:10
pecastro joined
11:21
wamba joined
11:35
tejr left
11:48
Sgeo left
11:49
tejr joined
11:53
aborazmeh joined
12:02
aborazmeh left
12:18
camelia joined
12:21
defaultxr left
12:22
defaultxr joined
12:41
aborazmeh joined
12:57
kylese joined
13:10
grumble joined
13:16
kylese left
13:17
kylese joined
13:34
Doc_Holliwood joined
13:43
mowcat joined
13:46
xheimlich left
13:55
xheimlich joined
14:16
kylese left
14:33
aborazmeh left
15:07
xelxebar left
15:09
xelxebar joined
15:22
monkey__ joined
15:23
orinthe left
15:31
gnufr33dom joined
15:48
pecastro left
15:53
parabolize joined
|
|||
Doc_Holliwood yawns | 16:06 | ||
tellable6 | 2021-02-14T01:33:59Z #raku <guifa2> Doc_Holliwood we had actually been talking about that for a while. The main thing is ensuring that people use :auth<foo>. IIRC, zef already will only use a github source owned by github user foobar given :auth<git:foobar> | ||
16:10
monkey__ left
16:38
domidumont left
|
|||
tbrowder | .ask lizmat can i add my blog test site to planet.raku.org without interfering with your generation of the raku weekly news? | 16:39 | |
tellable6 | tbrowder, I'll pass your message to lizmat | ||
16:43
atroxaper joined
|
|||
atroxaper | Hello, #raku | 16:43 | |
lizmat | tbrowder: yup :-) | ||
tbrowder | thnx | 16:44 | |
atroxaper | lizmat: Hello. I wrote a post about howto contribute in Raku (in Russian). Maybe you will want to add it in the weekly. twitter.com/atroxaper/status/13609...4992924674 | 16:46 | |
lizmat | atroxaper: cool, what would be an english title ? | 16:47 | |
asking rather than Google mangling it | |||
atroxaper | lizmat: Contributing to Raku for the little ones | 16:48 | |
lizmat | thanks! | 16:49 | |
16:50
pecastro joined
|
|||
atroxaper | ^^ | 16:50 | |
16:51
xheimlich left
16:52
domidumont joined
17:22
orinthe joined
17:28
gnufr33dom left
17:31
loops left
17:59
gnufr33dom joined
18:00
eseyman left
18:05
eseyman joined
18:10
domidumont left
18:18
atroxaper left
18:24
domidumont joined
18:32
domidumont left
18:33
Sgeo joined
18:41
guifa2 joined
18:55
leah2 left
19:10
[Sno] joined
19:13
sno left
|
|||
guifa2 | Jeez. Unit formatting is a LOT more complicated once you get to compound units. This actually might be worthy of a blog post | 19:18 | |
19:31
leah2 joined
19:47
wamba left
|
|||
perry | guifa2, units? I assume you don't mean the mathematical kind? | 19:57 | |
20:07
eseyman left,
eseyman joined
|
|||
SmokeMachine | .tell vrurg have you seen the new experimental feature from Red? (github.com/FCO/Red/issues/463#issu...778821143) | 20:23 | |
tellable6 | SmokeMachine, I'll pass your message to vrurg | ||
SmokeMachine | elcaro: have you seen the update for that post? 0racle.info/articles/exportation_e...ion_update | 20:31 | |
sorry, I saw the link and sent the message... | |||
20:40
orinthe left
20:41
orinthe joined
20:48
leah2 left
20:59
orinthe left,
orinthe joined
21:07
orinthe left
21:08
orinthe joined
|
|||
vrurg | SmokeMachine: thanks a lot! Gonna test it now. I was about to do write a workaround of my own. | 21:18 | |
tellable6 | 2021-02-14T20:23:24Z #raku <SmokeMachine> vrurg have you seen the new experimental feature from Red? (github.com/FCO/Red/issues/463#issu...778821143) | ||
21:23
rindolf left
|
|||
guifa2 | perry: the measurement kind. | 21:23 | |
perry | And unit formatting as in unit typesetting? | 21:24 | |
I know a thing or two about that, if so. | |||
guifa2 | format-unit(3, 'meter') --> "3 meters" | ||
problem gets when you have something crazy like | 21:25 | ||
perry | Ah. | ||
guifa2 | format-unit(4.5, 'kilogram-meters-per-millisecond') or something crazy | 21:26 | |
Unicode's devised a system that lets you go pretty crazy, even if the units make no sense | |||
perry | :D | ||
guifa2 | simple units are easy | 21:28 | |
github.com/alabamenhu/IntlFormatUn...t/Unit.pm6 | |||
but it'll be a nice blog post because it really can take advantage of grammars | 21:29 | ||
Unicode provides a grammar that took all of about one minute to convert to Raku's format. Add in some action classes to create some nodes that link back to the original data and boom. Raku makes something complicated easy. | 21:30 | ||
Trick is I haven't added the grammatical meta data into CLDR yet haha | |||
21:49
gnufr33dom left
21:54
cpage joined
22:04
orinthe left
22:05
orinthe joined
|
|||
elcaro | SmokeMachine: Yes I saw it... I wrote it! | 22:21 | |
SmokeMachine | elcaro: yes, of courseā¦ Iāve sent the link before really reading that, sorry | 22:27 | |
22:31
leah2 joined
22:43
Discipulus left
22:54
Garbanzo joined
|
|||
elcaro | SmokeMachine: np. Thanks again for your input on that :) | 23:07 | |
I still feel foolish for missing the obvious solution | 23:08 | ||
23:20
Doc_Holliwood left
23:23
aluaces left
23:53
sortiz joined
|