00:11:35 | * | xet7 quit (Read error: Connection reset by peer) |
00:13:40 | * | zachk quit (Quit: Leaving) |
00:45:27 | FromGitter | <zacharycarter> I want to play with forth more at some point - and compilers in general - I'm thinking, another pipe dream project is to write a forth interpreter with Nim |
00:55:12 | * | abm quit (Ping timeout: 244 seconds) |
00:57:44 | * | ftsf joined #nim |
00:58:56 | FromGitter | <malkomalko> I was playing around with go for a while and I'm definitely planning on going through https://interpreterbook.com/ and https://compilerbook.com/ in nim. Up next on my reading list is also the compiler docs. I'm very much interested to see how the compiler gets bootstrapped to allow for the compiler to be written in nim. |
00:59:34 | FromGitter | <zacharycarter> have you looked at - http://craftinginterpreters.com/ ? |
00:59:55 | FromDiscord_ | <malkomalko> Yah, but I don't think it's finished |
01:00:15 | * | Nolan[m] is now known as nolan_d |
01:00:26 | FromGitter | <zacharycarter> it's not - but I imagine unless you read really quickly, it would probably be done by the time you got through it |
01:00:33 | FromGitter | <zacharycarter> there's a lot of content in there and a lot of exercises / example code |
01:01:05 | FromDiscord_ | <malkomalko> https://www3.nd.edu/~dthain/compilerbook/ is also a good free resource |
01:01:24 | FromGitter | <zacharycarter> thanks! all three links you shared I hadn't seen before |
01:01:57 | FromGitter | <malkomalko> All good. It's definitely on my list post Nim in Action read through. |
01:18:19 | * | darithorn joined #nim |
01:31:34 | FromGitter | <malkomalko> so is the `/private` directory just a convention but not enforced in anyway? |
01:38:45 | * | redlegion quit (*.net *.split) |
01:38:46 | * | deepend quit (*.net *.split) |
01:38:47 | * | rlr quit (*.net *.split) |
01:38:47 | * | nif quit (*.net *.split) |
01:38:47 | * | flaviu quit (*.net *.split) |
01:38:47 | * | edcragg quit (*.net *.split) |
01:38:49 | * | craigger quit (*.net *.split) |
01:38:49 | * | Yardanico quit (*.net *.split) |
01:38:49 | * | JStoker quit (*.net *.split) |
01:38:49 | * | tobbez quit (*.net *.split) |
01:38:50 | * | def- quit (*.net *.split) |
01:38:50 | * | dada78641 quit (*.net *.split) |
01:38:51 | * | Jesin quit (*.net *.split) |
01:38:51 | * | MrAxilus[m] quit (*.net *.split) |
01:38:52 | * | enigmeta quit (*.net *.split) |
01:38:52 | * | LyndsySimon quit (*.net *.split) |
01:38:54 | * | TheKing[m] quit (*.net *.split) |
01:38:54 | * | Demos[m] quit (*.net *.split) |
01:38:56 | * | derlafff quit (*.net *.split) |
01:38:57 | * | sz0 quit (*.net *.split) |
01:38:57 | * | FromGitter quit (*.net *.split) |
01:38:58 | * | surma_ quit (*.net *.split) |
01:38:58 | * | AlexMax quit (*.net *.split) |
01:38:58 | * | copygirl quit (*.net *.split) |
01:38:59 | * | euantor quit (*.net *.split) |
01:38:59 | * | revere quit (*.net *.split) |
01:38:59 | * | crem quit (*.net *.split) |
01:39:00 | * | gmpreussner quit (*.net *.split) |
01:39:00 | * | grahamg quit (*.net *.split) |
01:39:00 | * | dvn quit (*.net *.split) |
01:39:00 | * | cornfeedhobo quit (*.net *.split) |
01:39:01 | * | Miguelngel[m] quit (*.net *.split) |
01:39:01 | * | nolan_d quit (*.net *.split) |
01:39:01 | * | toofly[m] quit (*.net *.split) |
01:39:01 | * | zielmicha[m] quit (*.net *.split) |
01:39:01 | * | TheManiac[m] quit (*.net *.split) |
01:39:01 | * | yglukhov[m] quit (*.net *.split) |
01:39:01 | * | pqflx3[m] quit (*.net *.split) |
01:39:02 | * | GitterIntegratio quit (*.net *.split) |
01:39:02 | * | pydsigner quit (*.net *.split) |
01:39:03 | * | skelett quit (*.net *.split) |
01:39:03 | * | MyMind quit (*.net *.split) |
01:39:03 | * | chemist69 quit (*.net *.split) |
01:39:03 | * | opi_ quit (*.net *.split) |
01:39:04 | * | flyx quit (*.net *.split) |
01:39:06 | * | Sentreen quit (*.net *.split) |
01:39:07 | * | xomachine[m] quit (*.net *.split) |
01:39:07 | * | vegax87 quit (*.net *.split) |
01:39:08 | * | gangstacat quit (*.net *.split) |
01:39:10 | * | lukd quit (*.net *.split) |
01:39:10 | * | r4vi quit (*.net *.split) |
01:39:11 | * | zielmicha__ quit (*.net *.split) |
01:39:11 | * | pigmej quit (*.net *.split) |
01:39:12 | * | bozaloshtsh quit (*.net *.split) |
01:39:12 | * | shodan45 quit (*.net *.split) |
01:39:12 | * | darithorn quit (*.net *.split) |
01:39:13 | * | shashlick quit (*.net *.split) |
01:39:14 | * | Tongir quit (*.net *.split) |
01:39:14 | * | joshbaptiste quit (*.net *.split) |
01:39:14 | * | erratic quit (*.net *.split) |
01:39:14 | * | pwntus quit (*.net *.split) |
01:39:14 | * | Sargun_ quit (*.net *.split) |
01:39:15 | * | masterm quit (*.net *.split) |
01:39:15 | * | acidx quit (*.net *.split) |
01:39:16 | * | nuxdie quit (*.net *.split) |
01:39:17 | * | Elronnd quit (*.net *.split) |
01:39:18 | * | junland quit (*.net *.split) |
01:39:18 | * | notbot[m] quit (*.net *.split) |
01:39:18 | * | Xe quit (*.net *.split) |
01:39:18 | * | snowolf quit (*.net *.split) |
01:39:19 | * | awal quit (*.net *.split) |
01:39:19 | * | macsek1911[m] quit (*.net *.split) |
01:39:20 | * | dashed quit (*.net *.split) |
01:39:20 | * | odc quit (*.net *.split) |
01:39:21 | * | Araq quit (*.net *.split) |
01:39:21 | * | SunDwarf quit (*.net *.split) |
01:39:22 | * | petersjt014[m] quit (*.net *.split) |
01:39:22 | * | dyce[m] quit (*.net *.split) |
01:39:22 | * | zacharycarter[m] quit (*.net *.split) |
01:39:24 | * | dom96 quit (*.net *.split) |
01:39:24 | * | Amun_Ra quit (*.net *.split) |
01:39:24 | * | qwertfisch quit (*.net *.split) |
01:39:25 | * | Zevv quit (*.net *.split) |
01:39:25 | * | planetis[m] quit (*.net *.split) |
01:39:25 | * | sg-james[m] quit (*.net *.split) |
01:39:25 | * | gh0st[m] quit (*.net *.split) |
01:39:25 | * | Connor[m]1 quit (*.net *.split) |
01:39:26 | * | syntonym[m] quit (*.net *.split) |
01:39:26 | * | endes[m] quit (*.net *.split) |
01:39:26 | * | stisa[m] quit (*.net *.split) |
01:39:26 | * | hitchhooker[m] quit (*.net *.split) |
01:39:26 | * | bitstoppa[m] quit (*.net *.split) |
01:39:26 | * | m712 quit (*.net *.split) |
01:39:27 | * | msmorgan_ quit (*.net *.split) |
01:39:28 | * | hogeland quit (*.net *.split) |
01:39:28 | * | ftsf quit (*.net *.split) |
01:39:29 | * | rockcavera quit (*.net *.split) |
01:39:29 | * | banc quit (*.net *.split) |
01:39:29 | * | leorize quit (*.net *.split) |
01:39:30 | * | mal``` quit (*.net *.split) |
01:39:31 | * | FromDiscord_ quit (*.net *.split) |
01:39:31 | * | c15ade4 quit (*.net *.split) |
01:39:32 | * | beatmox quit (*.net *.split) |
01:39:32 | * | fyber quit (*.net *.split) |
01:39:33 | * | zama quit (*.net *.split) |
01:39:34 | * | Tortice quit (*.net *.split) |
01:39:34 | * | voiceftp quit (*.net *.split) |
01:39:35 | * | ghost64 quit (*.net *.split) |
01:39:35 | * | masterdonx quit (*.net *.split) |
01:39:35 | * | avsej quit (*.net *.split) |
01:39:36 | * | regtools quit (*.net *.split) |
01:39:36 | * | Lord_Nightmare quit (*.net *.split) |
01:39:36 | * | oprypin quit (*.net *.split) |
01:39:37 | * | cavariux quit (*.net *.split) |
01:39:37 | * | d10n quit (*.net *.split) |
01:39:37 | * | ltr_ quit (*.net *.split) |
01:39:38 | * | ldlework quit (*.net *.split) |
01:39:38 | * | GaveUp quit (*.net *.split) |
01:39:38 | * | Widdershins quit (*.net *.split) |
01:39:40 | * | onionhammer quit (*.net *.split) |
01:39:41 | * | ven473 quit (*.net *.split) |
01:39:41 | * | jsn- quit (*.net *.split) |
01:39:42 | * | jonafato quit (*.net *.split) |
01:39:42 | * | kadin_ quit (*.net *.split) |
01:39:42 | * | CcxWrk quit (*.net *.split) |
01:39:42 | * | livcd quit (*.net *.split) |
01:39:43 | * | shadowbane quit (*.net *.split) |
01:39:44 | * | seni quit (*.net *.split) |
01:39:44 | * | tdc quit (*.net *.split) |
01:39:45 | * | gsingh93 quit (*.net *.split) |
01:39:46 | * | jxy quit (*.net *.split) |
01:39:46 | * | Cthalupa quit (*.net *.split) |
01:39:46 | * | ng0 quit (*.net *.split) |
01:39:47 | * | abeaumont quit (*.net *.split) |
01:39:48 | * | RushPL quit (*.net *.split) |
01:39:49 | * | monofuel[m] quit (*.net *.split) |
01:39:49 | * | vqrs quit (*.net *.split) |
01:39:49 | * | sendell[m] quit (*.net *.split) |
01:39:49 | * | SolitudeSF[m] quit (*.net *.split) |
01:39:49 | * | spymasterd[m] quit (*.net *.split) |
01:39:49 | * | jaens[m] quit (*.net *.split) |
01:39:49 | * | narimiran[m] quit (*.net *.split) |
01:39:49 | * | codevance[m] quit (*.net *.split) |
01:39:50 | * | jakeprem quit (*.net *.split) |
01:39:50 | * | Death916 quit (*.net *.split) |
01:39:50 | * | EastByte quit (*.net *.split) |
01:39:51 | * | SenasOzys quit (Quit: Leaving) |
01:45:00 | * | shodan45 joined #nim |
01:45:00 | * | pigmej joined #nim |
01:45:00 | * | zielmicha__ joined #nim |
01:45:00 | * | r4vi joined #nim |
01:45:00 | * | bozaloshtsh joined #nim |
01:45:00 | * | gangstacat joined #nim |
01:45:00 | * | lukd joined #nim |
01:45:00 | * | vegax87 joined #nim |
01:45:00 | * | euantor_ joined #nim |
01:45:00 | * | surma__ joined #nim |
01:45:00 | * | sz0_ joined #nim |
01:45:00 | * | EastByte joined #nim |
01:45:00 | * | Death916 joined #nim |
01:45:00 | * | jakeprem joined #nim |
01:45:00 | * | codevance[m] joined #nim |
01:45:00 | * | narimiran[m] joined #nim |
01:45:00 | * | jaens[m] joined #nim |
01:45:00 | * | spymasterd[m] joined #nim |
01:45:00 | * | SolitudeSF[m] joined #nim |
01:45:00 | * | sendell[m] joined #nim |
01:45:00 | * | vqrs joined #nim |
01:45:00 | * | monofuel[m] joined #nim |
01:45:00 | * | RushPL joined #nim |
01:45:00 | * | deepend joined #nim |
01:45:00 | * | redlegion joined #nim |
01:45:00 | * | xomachine[m] joined #nim |
01:45:00 | * | Sentreen joined #nim |
01:45:00 | * | flyx joined #nim |
01:45:00 | * | opi_ joined #nim |
01:45:00 | * | chemist69 joined #nim |
01:45:00 | * | MyMind joined #nim |
01:45:00 | * | skelett joined #nim |
01:45:00 | * | AlexMax_ joined #nim |
01:45:00 | * | der joined #nim |
01:45:00 | * | SunDwarf joined #nim |
01:45:00 | * | Araq joined #nim |
01:45:00 | * | odc joined #nim |
01:45:00 | * | dashed joined #nim |
01:45:00 | * | macsek1911[m] joined #nim |
01:45:00 | * | awal joined #nim |
01:45:00 | * | Xe joined #nim |
01:45:00 | * | notbot[m] joined #nim |
01:45:00 | * | snowolf joined #nim |
01:45:00 | * | junland joined #nim |
01:45:00 | * | Elronnd joined #nim |
01:45:00 | * | pydsigner joined #nim |
01:45:00 | * | pqflx3[m] joined #nim |
01:45:00 | * | yglukhov[m] joined #nim |
01:45:00 | * | GitterIntegratio joined #nim |
01:45:00 | * | TheManiac[m] joined #nim |
01:45:00 | * | toofly[m] joined #nim |
01:45:00 | * | zielmicha[m] joined #nim |
01:45:00 | * | Miguelngel[m] joined #nim |
01:45:00 | * | cornfeedhobo joined #nim |
01:45:00 | * | dvn joined #nim |
01:45:00 | * | grahamg joined #nim |
01:45:00 | * | nolan_d joined #nim |
01:45:00 | * | gmpreussner joined #nim |
01:45:00 | * | crem joined #nim |
01:45:00 | * | Cthalupa joined #nim |
01:45:00 | * | ng0 joined #nim |
01:45:00 | * | abeaumont joined #nim |
01:45:00 | * | jxy joined #nim |
01:45:00 | * | gsingh93 joined #nim |
01:45:00 | * | tdc joined #nim |
01:45:00 | * | seni joined #nim |
01:45:00 | * | shadowbane joined #nim |
01:45:00 | * | FromDiscord joined #nim |
01:45:00 | * | dada78641 joined #nim |
01:45:00 | * | def- joined #nim |
01:45:00 | * | JStoker joined #nim |
01:45:00 | * | Yardanico joined #nim |
01:45:00 | * | craigger joined #nim |
01:45:00 | * | edcragg joined #nim |
01:45:00 | * | flaviu joined #nim |
01:45:00 | * | nif joined #nim |
01:45:00 | * | tobbez joined #nim |
01:45:00 | * | rlr joined #nim |
01:45:00 | * | FromGitter joined #nim |
01:45:00 | * | livcd joined #nim |
01:45:00 | * | CcxWrk joined #nim |
01:45:00 | * | kadin_ joined #nim |
01:45:00 | * | jonafato joined #nim |
01:45:00 | * | jsn- joined #nim |
01:45:00 | * | ven473 joined #nim |
01:45:00 | * | onionhammer joined #nim |
01:45:00 | * | Widdershins joined #nim |
01:45:00 | * | GaveUp joined #nim |
01:45:00 | * | ldlework joined #nim |
01:45:00 | * | ltr_ joined #nim |
01:45:00 | * | d10n joined #nim |
01:45:00 | * | cavariux joined #nim |
01:45:00 | * | oprypin joined #nim |
01:45:00 | * | Lord_Nightmare joined #nim |
01:45:00 | * | regtools joined #nim |
01:45:00 | * | avsej joined #nim |
01:45:00 | * | masterdonx joined #nim |
01:45:00 | * | ghost64 joined #nim |
01:45:00 | * | voiceftp joined #nim |
01:45:00 | * | Tortice joined #nim |
01:45:00 | * | zama joined #nim |
01:45:00 | * | koppeh joined #nim |
01:45:47 | * | Jesin joined #nim |
01:45:47 | * | MrAxilus[m] joined #nim |
01:45:47 | * | LyndsySimon joined #nim |
01:45:47 | * | enigmeta joined #nim |
01:45:47 | * | Demos[m] joined #nim |
01:45:47 | * | TheKing[m] joined #nim |
01:45:50 | * | planetis[m] joined #nim |
01:45:50 | * | sg-james[m] joined #nim |
01:45:50 | * | gh0st[m] joined #nim |
01:45:50 | * | Connor[m]1 joined #nim |
01:45:50 | * | syntonym[m] joined #nim |
01:45:50 | * | stisa[m] joined #nim |
01:45:50 | * | endes[m] joined #nim |
01:45:50 | * | hitchhooker[m] joined #nim |
01:45:50 | * | bitstoppa[m] joined #nim |
01:45:50 | * | m712 joined #nim |
01:45:50 | * | msmorgan_ joined #nim |
01:45:50 | * | hogeland joined #nim |
01:45:54 | * | Zevv joined #nim |
01:45:54 | * | petersjt014[m] joined #nim |
01:45:54 | * | dyce[m] joined #nim |
01:45:54 | * | zacharycarter[m] joined #nim |
01:45:54 | * | dom96 joined #nim |
01:45:54 | * | Amun_Ra joined #nim |
01:45:54 | * | qwertfisch joined #nim |
01:45:57 | * | c15ade4 joined #nim |
01:46:03 | * | darithorn joined #nim |
01:46:03 | * | shashlick joined #nim |
01:46:03 | * | Tongir joined #nim |
01:46:03 | * | joshbaptiste joined #nim |
01:46:03 | * | pwntus joined #nim |
01:46:03 | * | Sargun_ joined #nim |
01:46:03 | * | masterm joined #nim |
01:46:03 | * | acidx joined #nim |
01:46:03 | * | nuxdie joined #nim |
01:46:09 | * | rockcavera joined #nim |
01:46:09 | * | banc joined #nim |
01:46:09 | * | leorize joined #nim |
01:46:09 | * | fyber joined #nim |
01:46:09 | * | mal``` joined #nim |
01:46:09 | * | beatmox joined #nim |
01:46:18 | * | thomasross quit (Remote host closed the connection) |
01:47:16 | * | shashlick quit (Remote host closed the connection) |
01:48:36 | * | FromGitter is now known as Guest40822 |
01:48:37 | * | c15ade4 is now known as Guest32018 |
01:48:57 | * | revere joined #nim |
01:48:59 | * | thomasross joined #nim |
01:50:27 | * | arecaceae quit (Ping timeout: 252 seconds) |
01:50:27 | * | so quit (Ping timeout: 252 seconds) |
01:51:43 | * | euantor_ quit (Changing host) |
01:51:43 | * | euantor_ joined #nim |
01:51:43 | * | surma__ quit (Changing host) |
01:51:43 | * | surma__ joined #nim |
01:51:43 | * | sz0_ quit (Changing host) |
01:51:43 | * | sz0_ joined #nim |
01:52:44 | * | arecaceae joined #nim |
01:54:15 | * | PrimHelios joined #nim |
02:04:24 | * | banc quit (Quit: ZNC - http://znc.in) |
02:09:38 | * | PrimHelios quit (Quit: Leaving) |
02:16:25 | * | erratic joined #nim |
02:19:55 | * | banc joined #nim |
02:22:51 | * | PrimHelios joined #nim |
02:34:38 | * | rockcavera quit (Ping timeout: 245 seconds) |
02:35:29 | * | rockcavera joined #nim |
02:46:17 | * | so joined #nim |
02:48:25 | * | AlexMax_ left #nim (#nim) |
02:49:21 | * | AlexMax joined #nim |
02:50:24 | * | vlad1777d quit (Ping timeout: 252 seconds) |
03:25:48 | * | chemist69_ joined #nim |
03:25:56 | * | chemist69 quit (Ping timeout: 260 seconds) |
04:28:41 | * | endragor joined #nim |
04:38:24 | * | narimiran joined #nim |
04:50:59 | * | anamok joined #nim |
05:41:28 | * | darithorn quit () |
05:47:25 | * | nsf joined #nim |
05:48:41 | * | cavariux quit (Quit: bye, bye!) |
05:48:48 | * | leorize quit (Ping timeout: 245 seconds) |
05:49:36 | * | cavariux joined #nim |
05:50:12 | * | cavariux quit (Client Quit) |
05:54:52 | * | cavariux joined #nim |
06:09:46 | * | cavariux quit (Quit: bye, bye!) |
06:10:42 | * | krux02 joined #nim |
06:12:04 | * | cavariux joined #nim |
06:15:17 | * | cavariux quit (Client Quit) |
06:15:48 | krux02 | goood morning |
06:16:09 | * | cavariux joined #nim |
06:19:09 | * | narimiran quit (Ping timeout: 244 seconds) |
06:22:08 | * | leorize joined #nim |
06:24:13 | anamok | morning |
06:28:45 | anamok | For writing OOP code that is similar to Python, what library is suggested? As I saw there are several solutions using macros. |
06:29:55 | krux02 | anamok, that is hard to say for me. I have very little Python experience. But the Nim way to write progras is to avoid OOP style of programming. |
06:30:25 | anamok | Nim doesn't force it, but you can do OOP if you want |
06:30:33 | krux02 | There is inheritance and that stuff, but Nim has other ideoms for generic reusable code that is more efficient than class hieracies. |
06:32:04 | * | shadwick joined #nim |
06:32:21 | krux02 | but if you just want to port some python code with the least possible effort into Nim, or if you want to use Nim without changing your habits of programming, I can understand this idea. |
06:32:40 | krux02 | anamok, can you name me examples of what you want to be able to do? |
06:33:56 | krux02 | Nim isn't dynamically typed |
06:34:20 | anamok | Nothing specific at the moment. I was just reading about OOP in Nim, but the syntax is a bit strange. |
06:36:44 | anamok | I'd like to create classes similarly to Python. There are macros for this, but I don't know if there is a preferred solution. |
06:37:09 | krux02 | you want a class syntax? |
06:37:25 | krux02 | No better get used to not use those macros. |
06:37:36 | krux02 | they are not necessary. |
06:38:39 | krux02 | unlike python, in Nim you don't need to "install" a method for a class. You can just create a free procedure with the "self" argument and you can already call it like a method |
06:40:48 | krux02 | I have seen how you create a class in Python, and I honesty think it is quite pointless. There is a "class" body with all its methods, but then from the methods you can't directly access members of the class, you still have to prefix it with self.method |
06:47:27 | anamok | Thanks. I will do some examples without the macros to get used to it. |
06:51:20 | krux02 | anamok, generally try to avoid inheritance, the preferred way in Nim is composition. |
06:52:10 | anamok | Do you have a doc/link about composition in Nim? |
06:52:33 | krux02 | no nothing Nim specific |
06:53:10 | krux02 | composition is just objects with members instead of object that inherit something |
06:57:20 | anamok | thanks |
07:06:35 | * | flaviu quit (Remote host closed the connection) |
07:06:58 | * | flaviu joined #nim |
07:08:16 | * | Yardanico quit (Quit: Quitting) |
07:08:33 | * | JStoker quit (Ping timeout: 252 seconds) |
07:08:37 | * | Yardanico joined #nim |
07:09:40 | * | dada78641 quit (Ping timeout: 252 seconds) |
07:10:12 | * | tobbez quit (Ping timeout: 252 seconds) |
07:10:26 | * | dada78641 joined #nim |
07:10:33 | * | JStoker joined #nim |
07:10:45 | * | tobbez joined #nim |
07:11:12 | * | Guest40822 quit (Remote host closed the connection) |
07:11:31 | * | FromGitter joined #nim |
07:31:13 | * | PMunch joined #nim |
07:37:14 | * | FromGitter quit (Remote host closed the connection) |
07:37:32 | * | FromGitter joined #nim |
07:40:19 | * | anamok quit (Ping timeout: 246 seconds) |
07:41:53 | * | floppydh joined #nim |
07:55:15 | * | koppeh quit (Quit: koppeh) |
07:55:22 | * | copygirl joined #nim |
08:03:12 | * | gmpreussner quit (Ping timeout: 250 seconds) |
08:03:43 | * | gmpreussner joined #nim |
08:05:48 | * | euantor_ quit (Changing host) |
08:05:48 | * | euantor_ joined #nim |
08:05:58 | * | euantor_ is now known as euantor |
08:08:45 | * | krux02_ joined #nim |
08:08:45 | * | krux02_ quit (Read error: Connection reset by peer) |
08:21:01 | FromGitter | <bung87> `castptr UncheckedArray[uint8 (self)` when converting a ptr float32 to ptr UncheckedArray what’s the inside type? `uint8 ` or `ptr uint8 `? |
08:24:37 | Araq | uint8 |
08:28:51 | * | shadwick quit (Quit: Page closed) |
08:30:54 | FromGitter | <bung87> ah thanks! |
08:33:37 | * | Vladar joined #nim |
08:33:50 | * | abm joined #nim |
08:34:26 | PMunch | Casting floats to unsigned integers, have history though us nothing! |
08:34:34 | PMunch | taught* |
08:37:14 | PMunch | Just kidding by the way. But when Ariane 5 was first launched it exploded when the computers shut down after unexpected values caused by a float to int conversion |
08:38:17 | PMunch | It was based on the older Ariane 4 design that didn't accelerate as quickly and therefore never reached the overflow of the int. But Ariane 5 was a lot faster and the int overflowed and the whole system went boom |
08:38:51 | PMunch | This was a cast from float64 to int16 by the way, not sure who thought that would be a good idea |
08:39:00 | FromGitter | <bung87> ah,I didnot know that |
08:40:30 | FromGitter | <bung87> I’m porting a cpp lib seems like I need implement all the `[]` `+=` `-=` procs |
08:40:33 | PMunch | Half a billion USD rocket was lost because of hit |
08:41:19 | PMunch | What library? |
08:41:49 | FromGitter | <bung87> https://github.com/facebookresearch/fastText |
08:43:54 | PMunch | Huh, interesting |
08:55:22 | FromGitter | <bung87> is there a example for something in cpp like this `centroids[k * d + j2] += sign * eps` centroids is ptr float32 |
08:56:15 | FromGitter | <bung87> I’m not sure I write correctly so far :( |
08:58:03 | leorize | bung87: you wanted to wrap C++ `+=` in Nim? |
08:58:43 | FromGitter | <bung87> there are so many pointer operation in the fastext |
08:59:17 | FromGitter | <bung87> I’v never programming in such low level . |
09:00:17 | FromGitter | <bung87> leorize I dunno maybe using memset or something .. |
09:00:49 | PMunch | bung87, well that is probably an array |
09:01:10 | PMunch | A pointer in C++ can also be a C style array |
09:02:05 | PMunch | So centroids[k * d + j2] is the same as centroids + (k * d + j2)*sizeof(float32) |
09:02:12 | * | abm quit (Ping timeout: 252 seconds) |
09:02:36 | PMunch | So what's actually going on there is += on the float located at that position |
09:03:01 | leorize | or `cast[ptr UncheckedArray[float32]](centroids)[k * d + j2]` |
09:03:25 | PMunch | Yeah, that's what you would use in Nim |
09:03:34 | PMunch | I ended up writing some strange C/Nim hybrid :P |
09:03:36 | * | krako joined #nim |
09:03:46 | FromGitter | <bung87> does it unit8 inside ? |
09:03:52 | FromGitter | <bung87> araq just told me |
09:04:13 | PMunch | That's because you cast it to an UncheckedArray of uint8s |
09:04:56 | PMunch | What leorize did there was cast the centroids pointer to an unchecked array of float32, which is what C++ assumes it is |
09:05:07 | PMunch | Nim is just stricter with pointers |
09:05:10 | FromGitter | <bung87> the cpp will assign the value to that offset |
09:05:54 | FromGitter | <bung87> but I get uint8 not a ptr |
09:06:37 | PMunch | What is the exact code you are trying to convert? |
09:08:36 | FromGitter | <bung87> just that one line code ,I mean `cast[ptr UncheckedArray[uint8]][offset]` here I will get a `uint8` ? |
09:08:56 | PMunch | Yes, since you're casting to uint8.. |
09:10:28 | FromGitter | <bung87> so it is a copy value store in other memory space ? then how can I assign value to original memory address |
09:10:45 | leorize | no, it's not |
09:11:33 | FromGitter | <mratsim> do `let a = cast[ptr UncheckedArray[uint8]]` then `a[0] = 1` |
09:12:03 | PMunch | http://ix.io/1oPT/Nim |
09:12:50 | PMunch | bung87, the three first lines simulates a pointer to an array from C/C++ |
09:13:01 | PMunch | This is what centroids is |
09:13:41 | * | abm joined #nim |
09:13:56 | FromGitter | <narimiran> i have very limited knowledge of those things, so can somebody explain why the third line in PMunch's example isn't just `arrp = addr statarr`? |
09:14:20 | FromGitter | <bung87> ah I get you guys point , a[0] = 1 will assign to the original address |
09:14:32 | PMunch | It could've been, but I wanted to completely remove the type information for the sake of the example |
09:14:59 | PMunch | uarr is making Nim aware that arrp is an array of floats and not a pointer to a something else. But we are just casting the pointer, so when Nim assigns to uarr[1] we can see that statarr[1] also updates it's value |
09:16:05 | PMunch | All of this just exists in Nim as type information, all of these casts and stuff don't actually do anything, it just tells Nim what type the pointer is, and by that what procedures should be available for it |
09:16:06 | * | leorize quit (Ping timeout: 264 seconds) |
09:16:41 | PMunch | Arrays have [] defined for them, so by casting our pointer to an array we can use [] on it |
09:17:02 | PMunch | If we had tried to access something that was out of the range of the array it could lead to an error |
09:17:09 | FromGitter | <bung87> so it does like a `void*` in c / |
09:18:30 | * | vlad1777d joined #nim |
09:19:17 | PMunch | In fact if we do this: http://ix.io/1oPV/Nim you can see that Nim now thinks the pointer is a single float, and allows us to use += on it, which works since the element pointed to be the pointer is in fact a float (an array of floats is just floats placed one after another in memory, and [] just calculates which address to retrieve a float from) |
09:20:24 | FromGitter | <narimiran> PMunch so casting this way is bit more explicit than using `addr foo`, but under the hood they are the same? or not? |
09:21:08 | PMunch | addr foo returns the address of the variable foo |
09:21:17 | PMunch | It's the opposite of the cast |
09:21:55 | FromGitter | <bung87> that’s interesting example |
09:22:27 | PMunch | You see on line 3 I use addr get the address to statarr (which is the address of the first float). |
09:23:03 | FromGitter | <narimiran> hmmm, why does replacing `castpointer (statarr.addr)` with `addr statarr` work then? |
09:24:01 | FromGitter | <narimiran> as i said, my knowledge is very limited, and usually i see disclaimers "use 'cast' only if you really know what you're doing", and i don't know what i'm doing so i have never experimented with them |
09:24:37 | PMunch | Ah, addr statarr (or statarr.addr) returns a ptr array[3, float64], the cast just hides what it's a pointer to |
09:25:11 | PMunch | Nim keeps track of what things are a pointer to, with the cast[pointer] I hide this information from the compiler |
09:26:45 | PMunch | We can cast it to something else as well. In this case I cast it to an integer, then I add the size of a float to the integer before casting it back to a float: http://ix.io/1oPY/Nim |
09:27:23 | PMunch | Since the floats are placed back to back in memory this is essentially the same as statarr[1] |
09:28:00 | PMunch | |float|float|float |
09:28:24 | PMunch | The pointer initially points to the first pipe, when adding the size of a float to the pointer it now points to the second pipe. |
09:29:03 | FromGitter | <narimiran> yeiy, i can understand that :) |
09:29:29 | FromGitter | <narimiran> thanks for the illustrating example |
09:29:37 | PMunch | No problem :) |
09:33:34 | FromGitter | <narimiran> with `arrp = addr statarr`, `arrp[]` is the whole array; with `arrp = castptr float (statarr.addr)`, you point just to the first element |
09:34:29 | FromGitter | <mratsim> https://github.com/nim-lang/graveyard fun |
09:35:09 | PMunch | narimiran, correct |
09:36:50 | PMunch | mratsim, haha like the name :P |
09:37:34 | PMunch | Hmm, I need to find something to PR for Hacktoberfest |
09:37:59 | FromGitter | <bung87> `centroids[k * d + j] += sign * eps` I re checked the code , `eps` is also a float32 ,will it hit the stack overflow ? |
09:38:00 | FromGitter | <narimiran> PMunch don't you have 4 PRs already with Options? :) |
09:38:14 | FromGitter | <technicallyagd> Obsolete meaning it should not be used? or just being kicked out of the `stdlib`? |
09:38:37 | FromGitter | <narimiran> @technicallyagd both :) |
09:39:39 | FromGitter | <narimiran> @technicallyagd this is why those packages are in the graveyard: https://github.com/nim-lang/Nim/issues/8238#issuecomment-403225632 |
09:39:53 | PMunch | narimiran, yeah. But I need 5 :) |
09:40:03 | FromGitter | <technicallyagd> PMunch if you don't mind the slightly sinister approach, you can actually make a pull request to your own repo |
09:40:13 | PMunch | bung87, why would it hit a stack overflow? |
09:40:15 | FromGitter | <technicallyagd> @narimiran Ah! I see, thank you. |
09:40:50 | PMunch | technicallyagd, yeah I know. But I feel that's cheating :P |
09:40:54 | FromGitter | <bung87> I mean out of the value range ? |
09:41:08 | PMunch | Oh, well you could theoretically |
09:41:20 | FromGitter | <mratsim> unchecked array has their name implied has no bound checking |
09:41:31 | FromGitter | <mratsim> as* |
09:42:49 | PMunch | mratsim, that shouldn't be an issue. I assume Facebook made sure the array wouldn't access outside its bounds |
09:43:03 | * | rockcavera quit (Remote host closed the connection) |
09:43:25 | FromGitter | <bung87> oh it as it is. |
09:45:46 | FromGitter | <mratsim> btw @Vindaar do you need some help for NimYaml: https://github.com/flyx/NimYAML/pull/64 Starting tomorrow/friday I will probably use it as Ethereum 2.0 testing suite will be yamal based instead of Json based. |
09:46:29 | FromGitter | <technicallyagd> @PMunch lol indeed, since there's still 35,000+ T-shirts to go, cheating is probably not necessary. |
09:51:03 | * | rockcavera joined #nim |
10:03:46 | FromGitter | <narimiran> @PMunch there are 1443 in nim repo to pick, i'm sure you can find one to make PR :) |
10:03:56 | FromGitter | <narimiran> *1443 open issues |
10:05:31 | FromGitter | <bung87> 1443 hehe |
10:06:13 | * | xet7 joined #nim |
10:08:00 | FromGitter | <narimiran> let's make that 1337 ;) (https://en.wikipedia.org/wiki/Leet) |
10:17:26 | FromGitter | <bung87> intersting thing |
10:26:35 | FromGitter | <technicallyagd> Is there a way to know which part of the language is likely to change so one could avoid using it? |
10:34:27 | * | krux02 quit (Remote host closed the connection) |
10:35:29 | FromGitter | <narimiran> @technicallyagd there is {.experimental.} pragma for some stuff, so you should be prepared that that might change, but other than that, i think you shouldn't limit yourself too much as the language shouldn't change to much as we're preparing for v1.y |
10:35:32 | FromGitter | <narimiran> 1) v1.0 |
10:41:06 | FromGitter | <kaushalmodi> Continuing a conversation from https://github.com/nim-lang/Nim/pull/9266#issuecomment-428486750: why would one pick runnableExamples vs commented rst code blocks in docstrings? |
10:41:30 | FromGitter | <kaushalmodi> Seems like both kinds of code blocks runs as tests during `nim doc` |
10:43:48 | FromGitter | <kaushalmodi> TheLemonMan: Does that commit mean that RST code blocks will run on "nim doc" only if ":test:" is found in those? |
10:44:28 | FromGitter | <kaushalmodi> If so, why do you have "Don't run it!" in that example? |
10:46:15 | FromGitter | <narimiran> @kaushalmodi because it will raise an exception? (yeah, some other example might be better to show that capability of code block) |
10:46:19 | FromGitter | <kaushalmodi> Also, you said "This was already the case when the documentation was exported as html/tex.". That's confusing too.. "nim doc" generates html? So what's the "already the case"? |
10:47:37 | FromGitter | <kaushalmodi> @narimiran I understood the exception part, but who's the "Don't run it!" for? It contradicts with ":test:". |
10:47:56 | FromGitter | <kaushalmodi> So does that code block run during "nim doc" or not? |
10:48:09 | FromGitter | <kaushalmodi> If it does, what about the exception? :) |
10:50:47 | FromGitter | <kaushalmodi> Basically I want to document for myself on the differences between (1) runnableExamples (2) rst code block with ":test:", and (3) rst code block without ":test:". |
10:52:38 | * | PrimHelios quit (Ping timeout: 250 seconds) |
10:54:11 | Araq | technicallyagd: stay away from .experimental and you're very safe. the not-nil strings/seqs were a bigger breaking change than what came before and afterwards |
11:17:14 | FromGitter | <xmonader> guys how do you build static binary of the whole application in nim? |
11:17:40 | FromGitter | <xmonader> I've a demo in 30 mins and i don't know how really |
11:17:48 | * | couven92 joined #nim |
11:18:37 | Araq | --app:staticlib |
11:19:16 | Araq | but it usually alsos requires --cppCompileToNamespace:Xyz and compilation to C++ |
11:20:02 | FromGitter | <xmonader> i'm also using -d:ssl |
11:26:59 | FromGitter | <xmonader> @araq it's a console app u thing --app:console would help? |
11:29:16 | FromGitter | <kaushalmodi> I don't think this will statically compile SSL, but in any case I did an experiment with building static binaries using musl, and it worked out well: https://github.com/kaushalmodi/hello_musl |
11:29:39 | FromGitter | <kaushalmodi> I'm using the same approach on a real Nim project ntangle, and it works great there too. |
11:31:08 | FromGitter | <kaushalmodi> 30 mins? May be installing ssl on your demo machine is faster :) |
11:38:56 | * | kmies joined #nim |
11:40:30 | * | kmies quit (Client Quit) |
11:52:20 | * | Flox[m] joined #nim |
11:55:18 | * | elrood joined #nim |
12:03:26 | Flox[m] | I am getting an error when a node js client sends a request to my asynchttpserver. does anybody know what this error means? |
12:03:27 | Flox[m] | Error: unhandled exception: /opt/Nim/lib/pure/ioselects/ioselectors_epoll.nim(180, 11) ` |
12:03:27 | Flox[m] | not (pkey.ident == InvalidIdent)` Descriptor 14 is not registered in the selector! |
12:04:41 | FromGitter | <technicallyagd> @Araq @narimiran okay, thank you. |
12:07:58 | * | Flox[m] is now known as hohlerde |
12:08:17 | FromGitter | <xmonader> @kaushalmodi they want to use the app themselves i think i'll just record it until i figure out how to do the static binary cleanly |
12:10:46 | FromGitter | <kaushalmodi> Yeah, the static binary happens cleanly using musl, but without ssl. Please ping me if you find a solution to statically compile ssl dep too. |
12:11:01 | FromGitter | <kaushalmodi> I have another project in pipeline that can make use of that. |
12:11:26 | * | Vladar quit (Remote host closed the connection) |
12:15:25 | * | kmies joined #nim |
12:16:53 | * | kmies quit (Client Quit) |
12:17:49 | * | anamok joined #nim |
12:17:51 | anamok | hi |
12:17:57 | hohlerde | the complete stacktrace: https://privatebin.tarakis.de/?fa68ea7c6c81ebd3#jTmy83RY8oFMAswXXro3IBEGONEzqDz8sd28P9DRCrQ= |
12:17:58 | hohlerde | and basically the loop in my thread calling poll: |
12:17:59 | hohlerde | https://privatebin.tarakis.de/?41832fcd19770e59#SgADrwfbY5/SjOSR0qxSsQM26C6tu11vdT818o2uYsQ= |
12:19:40 | anamok | Is the sugar module stable (more or less)? I ask it because future was like a sandbox, things moved out of it with new releases. What about sugar? |
12:19:54 | FromGitter | <tim-st> When the stdlib starts using Concept types, should every type be redefined in each module? |
12:22:31 | FromGitter | <tim-st> I think it's better to define a `StringLike` in `system.nim` and maybe this should be separated between readonly StringLike and mutuable StringLike |
12:22:41 | FromGitter | <rokups> i need to pass a proc to a c function. is there some magic pragma that will make code pass raw function pointer instead of a magic struct that nim seems to create for procs? `exportc` somehow is not doing any difference |
12:23:05 | * | leorize joined #nim |
12:23:33 | FromGitter | <rokups> generated code is `T1_.ClP_0 = ((TM_VmYOAKcSs9cz9aBmfJ9bgam7Q_16) (entryPointWrapper)); T1_.ClE_0 = NIM_NIL; newCtx = make_fcontext(stack.stack, stack.size, T1_);` where i need `newCtx = make_fcontext(stack.stack, stack.size, &entryPointWrapper);` |
12:23:38 | Araq | rokups, look up "calling conventions", most likely you want a .cdecl annotation |
12:23:51 | FromGitter | <rokups> ah ha, thanks |
12:24:18 | Araq | anamok: the 'lc' will be deprecated the other things in there are fine I think |
12:25:12 | FromGitter | <kaushalmodi> Araq: can you comment on the runnableExamples vs rst code blocks. |
12:25:20 | anamok | Araq, will 'lc' disappear in the future? What's wrong with it? Should we use map and filter? |
12:25:55 | FromGitter | <narimiran> @anamok it is ugly! :D |
12:26:07 | FromGitter | <kaushalmodi> anamok: there are few alternatives to lc. I linked my notes yesterday so won't spam that here again. |
12:26:14 | Araq | in 0.19 we got for-loop expressions that we should make use of |
12:26:38 | FromGitter | <kaushalmodi> In there, look for List Comprehension section for lc and alternatives. |
12:26:53 | Araq | kaushalmodi: I'm still making up my mind. |
12:27:19 | FromGitter | <kaushalmodi> Araq: OK, it would be nice for one way to write docstrings tests |
12:27:26 | anamok | I learned about lc yesterday and I was happy to see that it was similar to python :) |
12:27:31 | FromGitter | <kaushalmodi> Having 2 ways is .. inconsistent :) |
12:27:42 | Araq | for now I'm leaning towards a new '.. code-block:: nimtest' RST feature :P |
12:27:44 | FromGitter | <Vindaar> @mratsim thanks! I'm mostly done now I think. One thing to address and then fix the last test case (which I think is a simple fix). You're welcome to review the PR though! |
12:27:52 | FromGitter | <kaushalmodi> Araq: Noooo |
12:28:39 | FromGitter | <kaushalmodi> runnableExamples is a nice Nim-specific but not doc language specific feature |
12:29:51 | Araq | glad you like it, feels like nobody else does :-) |
12:30:01 | FromGitter | <tim-st> Araq: will `StringLike` also be used for `var` strings? |
12:30:20 | Araq | right now not even parseutils works with StringLike |
12:30:59 | Araq | but that aside, it's not yet clear what the concepts need to look like. |
12:31:01 | FromGitter | <narimiran> i like it too! so that makes three of us :P |
12:31:09 | FromGitter | <tim-st> yes, but defining this in each module that uses string is a bit bad. Also StringLike could support zero copy strings when defined good |
12:31:35 | Araq | this zero-copy-madness must stop. |
12:32:09 | FromGitter | <tim-st> it's only for database wrapper, when I see python can do it and go and others and Nim not, I'm wondering why |
12:32:32 | Araq | it's completely out of touch with how the hardware works, all cache layers *copy* |
12:33:03 | FromGitter | <tim-st> I saw benchmark with the zero copy string which was much quicker |
12:33:18 | FromGitter | <tim-st> (in another language) |
12:33:29 | Araq | and I saw benchmarks where it made no difference. |
12:33:53 | FromGitter | <tim-st> especially for range iteration with kvstore, maybe not for sqlite |
12:33:59 | Araq | what hurts is not the copy, it's the allocations and the resulting GC pressure |
12:33:59 | FromGitter | <kaushalmodi> About runnableExamples, @timotheecour is onboard too, so that's 4 of us |
12:34:40 | Araq | I've also seen benchmarks where memmap loses against fread |
12:34:49 | FromGitter | <kaushalmodi> (we need an official poll for this: feature request to add polling to nimforum) |
12:35:26 | PMunch | kaushalmodi, oh that would be nice |
12:35:31 | anamok | In sequtils we have all and any, but `none` is missing. It would be useful too. |
12:35:59 | Araq | none is just 'not any' |
12:36:52 | FromGitter | <kaushalmodi> PMunch: GitHub has a feature to add polling to issues. Araq just has to enable it. |
12:37:15 | FromGitter | <alehander42> runnableExamples is better than more custom RST stuff 10 of 10 times |
12:37:20 | Araq | thumbs up/down is ok, what does that require another app? |
12:37:26 | anamok | How to put that in a chain? toSeq(...).any(...) |
12:38:20 | Araq | flox[m]: please report it on github |
12:38:39 | FromGitter | <kaushalmodi> Araq: It's more visual, and allows polling among non-binary options. |
12:38:42 | hohlerde | ok |
12:38:54 | FromGitter | <kaushalmodi> But in any case, I digress. |
12:38:58 | FromGitter | <alehander42> @anamok i also used list comprehensions in python, but that's because map/filter and lambdas suck there: you need to constantly write lambda and you can't `.` chain them |
12:39:17 | Araq | kaushalmodi, sorry, but did you look into nightlies? we need it |
12:39:31 | FromGitter | <alehander42> in languages like ruby, elixir, nim (randome examples) I think chaining functional methods seems nicer |
12:40:41 | FromGitter | <kaushalmodi> Araq: You mean deploying Nim builds on nightlies? |
12:41:36 | FromGitter | <narimiran> Araq: should the remaining two files (nimblepkglist.nim and website.ini) be removed from the 'web' folder? |
12:42:06 | FromGitter | <kaushalmodi> Araq: asking because there was also the thing about running htmltest on nightlies. |
12:42:21 | Araq | about deploying Nim builds |
12:42:47 | Araq | narimiran: yeah |
12:43:06 | FromGitter | <kaushalmodi> Araq: OK, I'll look into deploying via Travis at least. I'm not much conversant with Appveyor/Windows. |
12:43:13 | FromGitter | <narimiran> ok, i'll do it |
12:43:57 | * | krux02 joined #nim |
12:44:00 | anamok | alehander42, I agree. In Python I almost never use map and filter, but in nim they're nice. Especially with mapIt and filterIt. |
12:45:08 | Araq | sum(for a in x: for b in a: if b != 0: b) # iirc that's now possible in 0.19 |
12:47:05 | FromGitter | <narimiran> Araq that looks better than `lc`! |
12:47:42 | anamok | Araq, is it like a generator expression in Python? It doesn't build a sequence, right? |
12:50:15 | Araq | it's just syntax, 'sum' needs to be a macro that does all the work |
12:50:39 | anamok | For checking if a text doesn't contain and lowercase letters, I used this: `text.allIt(not it.isLowerAscii)`. Here `none` would look better: `text.noneIt(it.isLowerAscii)`. |
12:50:54 | FromGitter | <narimiran> web folder deleted. next in the category "boring but long overdue": all those stale branches waiting to be deleted |
12:55:18 | Araq | yeah, the branches ... I gave up on them |
12:56:03 | Araq | kaushalmodi: there is also a "github deploy" Nimble package or similar that could be useful |
12:56:39 | FromGitter | <kaushalmodi> Yes, github_release |
12:57:03 | FromGitter | <narimiran> Araq well, i'm in the cleaning mood (as you can tell :)), i'm willing to do it if you want |
12:58:43 | livcd | Did you guys try "sciter" ? |
13:08:23 | * | chemist69_ quit (Quit: WeeChat 2.2) |
13:08:39 | * | chemist69 joined #nim |
13:17:02 | * | PrimHelios joined #nim |
13:26:09 | FromGitter | <rokups> hmm is it possible that nim tries to build assembly (.S) files as native arch even if --cpu:i386 is passed? |
13:31:16 | planetis[m] | does nim need somthing like this: https://github.com/python/cpython/blob/master/Modules/mathmodule.c#L1299 ? |
13:32:52 | anamok | Kotlin has none, see here: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/none.html . I just did `none` and `noneIt` in nim with templates. Can I send an issue about it on Github for further discussion? |
13:33:38 | FromGitter | <stvnfx> Hey everyone, does anyone know what "Error: 'spawn' takes a GC safe call expression” means? |
13:34:02 | planetis[m] | julia offers 'sumPairwise' and used to had this: https://en.wikipedia.org/wiki/Kahan_summation_algorithm#Further_enhancements then it got moved in a library |
13:34:22 | PMunch | anamok, why not just len == 0? |
13:34:32 | planetis[m] | which algorithm to port? |
13:34:57 | anamok | PMunch: go down to the bottom of the page. I mean the other `none`. |
13:35:11 | FromGitter | <mratsim> I think I just found the weirdest Nim bug, does the following crash for you and does removing the comment fix it? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe000f600c5f642384c727] |
13:35:16 | Araq | narimiran, sure if you can do it |
13:35:19 | anamok | where none can have a predicate |
13:37:06 | Araq | @mratsim not really weird the doc comment means it stays an nkStmtList and somewhere in the C backend we don't understand this |
13:37:12 | FromGitter | <narimiran> Araq I would need "admin rights" (or whatever it is called to become collaborator/maintainer), so if you can give me that for the next half an hour (than take it back) i'll do it |
13:37:15 | Araq | *nkStmtListExpr |
13:37:47 | FromGitter | <mratsim> Are you saying that comments are allowed to crash the C backend? :P |
13:38:37 | FromGitter | <mratsim> oj, If I use a single # instead of ## it works, I see |
13:38:41 | FromGitter | <mratsim> oh* |
13:40:29 | PMunch | anamok, ah, that makes more sense |
13:40:44 | PMunch | filter.len |
13:41:43 | anamok | PMunch: example: check if a string has no lowercase letters: `text.none(isLowerAscii) == true` |
13:42:44 | anamok | but it's missing from sequtils |
13:42:48 | FromGitter | <narimiran> `text.any(isLowerAscii) == false` |
13:43:01 | FromGitter | <kaushalmodi> Just saying, Emacs Magit makes it easy to delete branches :) |
13:43:16 | FromGitter | <kaushalmodi> It's literally 2 key presses `bk` |
13:43:39 | anamok | narimiran: yes, but that's harder to read IMO. One needs to think more :) |
13:46:26 | anamok | You can read `text.none(isLowerAscii)` like this: "in text, no character is lowercased". |
13:49:13 | * | der quit (Remote host closed the connection) |
13:49:24 | PMunch | Makes sense I guess |
13:50:02 | * | vlad1777d quit (Ping timeout: 272 seconds) |
13:51:25 | * | derlafff joined #nim |
13:54:27 | * | couven92 quit (Read error: Connection reset by peer) |
13:55:23 | * | rockcavera quit (Remote host closed the connection) |
14:00:35 | * | TheLemonMan joined #nim |
14:00:49 | * | stefanos82 joined #nim |
14:01:09 | TheLemonMan | kaushalmodi, I just wanted to show that you can keep writing your comment after the code block |
14:01:54 | anamok | I opened an issue for this addition: https://github.com/nim-lang/Nim/issues/9282 |
14:02:36 | * | endragor quit (Remote host closed the connection) |
14:02:51 | TheLemonMan | can't you just use not any(...) ? |
14:03:33 | anamok | "any" is "not all". Why is there "any" then? |
14:04:29 | PMunch | any isn't not all |
14:04:30 | TheLemonMan | for the same reason we don't have != but only == |
14:04:31 | FromGitter | <narimiran> "any" is "some". it could be one, it could be all, it could be in between |
14:05:57 | FromGitter | <technicallyagd> also, `not all` can be `none` |
14:06:01 | FromGitter | <narimiran> anamok: "In the module sequtils, we have map and filter, but none is missing" i guess you wanted to say that we have all and any? |
14:07:00 | anamok | narimiran: right, thanks; corrected |
14:09:05 | TheLemonMan | planetis, the Kahan Babushka Neumaier algorithm! |
14:09:42 | planetis[m] | alright lol |
14:09:51 | planetis[m] | did you pick it for the name ;) |
14:10:55 | planetis[m] | I thought msum was the most presice and difficult to port but I could do it if its worth it. |
14:11:05 | TheLemonMan | of course heh I don't know if that's faster than pairwise tho |
14:11:27 | TheLemonMan | but if you want to benchmark them you're in the right place at the right time |
14:11:45 | planetis[m] | pairwise is quite simple but gives wrong results when len > 125 |
14:12:02 | planetis[m] | pairwise is def the fastest |
14:12:09 | planetis[m] | and msum slowest |
14:12:53 | * | nsf quit (Quit: WeeChat 2.2) |
14:13:17 | planetis[m] | i will make pr and upload all the algorithms |
14:13:23 | * | PrimHelios quit (Ping timeout: 245 seconds) |
14:13:31 | planetis[m] | Got to earn that t-shirt :p |
14:16:00 | * | PrimHelios joined #nim |
14:19:57 | * | tay_ joined #nim |
14:20:28 | * | tay_ quit (Client Quit) |
14:20:47 | * | tay_ joined #nim |
14:20:48 | * | tay_ quit (Remote host closed the connection) |
14:22:30 | * | PrimHelios quit (Ping timeout: 252 seconds) |
14:30:57 | anamok | bye |
14:31:07 | * | anamok quit (Quit: Leaving) |
14:35:35 | * | PrimHelios joined #nim |
14:38:42 | * | pigmej quit (Ping timeout: 252 seconds) |
14:40:32 | FromGitter | <mratsim> how about creating a high precision arithmetic lib :P |
14:40:49 | * | pigmej joined #nim |
14:53:58 | * | Vladar joined #nim |
14:59:02 | * | narimiran joined #nim |
15:03:23 | * | narimiran quit (Client Quit) |
15:03:50 | * | narimiran joined #nim |
15:04:10 | * | tay_ joined #nim |
15:05:38 | * | PrimHelios quit (Ping timeout: 244 seconds) |
15:06:39 | * | hzx joined #nim |
15:10:03 | * | tay_ quit (Ping timeout: 245 seconds) |
15:11:58 | * | PrimHelios joined #nim |
15:14:38 | * | PMunch quit (Quit: Leaving) |
15:21:14 | * | PrimHelios quit (Quit: Leaving) |
15:25:51 | * | endragor joined #nim |
15:27:19 | * | Pisuke joined #nim |
15:28:21 | * | MyMind quit (Ping timeout: 260 seconds) |
15:30:41 | * | endragor quit (Ping timeout: 260 seconds) |
15:31:28 | * | floppydh quit (Quit: WeeChat 2.2) |
15:33:23 | FromGitter | <Varriount> @mratsim Don't we already have an arbitrary precision arithmatic lib? |
15:35:16 | hzx | is the iup gui package still offical part of Nim? The included version is from 2009... |
15:36:28 | FromGitter | <mratsim> @Varriount arbitrary is not higher precision than high ;) |
15:36:35 | FromGitter | <mratsim> but the cost is also high |
15:36:53 | FromGitter | <mratsim> arbitrary is higher* |
15:38:00 | TheLemonMan | hzx, you're lucky then, the libzip version shipped by the `zip` package is from 2007 |
15:38:42 | hzx | yikes |
15:38:56 | FromGitter | <mratsim> and C is from 89 ;) |
15:40:03 | hzx | yes, but everyone should use the c11 vesion :) |
15:40:22 | hzx | or the c18 |
15:40:47 | TheLemonMan | this IUP thing looks nice but Tk is still my go-to solution for portable guis |
15:42:36 | hzx | The iup.nim wrapper were created with c2nim and then hand-crafted... if I create a new one based on the latest IUP version, where should I send it? |
15:43:57 | TheLemonMan | send a PR here https://github.com/nim-lang/iup |
15:44:33 | hzx | hm, "The wrapper was originally part of the standard library. This project was created to remove it from the standard library, update it to the latest version of IUP and integrate it with nimble." |
15:45:09 | TheLemonMan | 2 out of 3 tasks were done :P |
15:45:09 | narimiran | hzx: congrats, you've became a maintainer of nimble package :) |
15:46:47 | TheLemonMan | it'd be nice to have a iup-sys package with the "raw" C bindings only and a iup one where the bindings are shaped in a nim-esque form |
15:46:54 | TheLemonMan | nim-eable? |
15:47:00 | TheLemonMan | nim-ish? |
15:47:01 | hzx | huh, maybe those shoes are too big for me, but will try |
15:49:23 | hzx | raw c bindings won't work in every cases |
15:49:49 | * | darithorn joined #nim |
15:50:13 | hzx | KS_a and KS_A defines had to be renamed KS_lowerA and KS-upperA for example |
15:50:50 | hzx | because of case insensitivity |
15:51:58 | * | Trustable joined #nim |
15:52:46 | * | shashlick joined #nim |
15:53:46 | FromGitter | <Vindaar> @mratsim so from my side I'm almost done with the yaml PR. Still have 2 questions, see in my last comment: https://github.com/flyx/NimYAML/pull/64#issuecomment-428626879 If you have any ideas, feel free to comment! :) |
16:00:40 | narimiran | anybody has an idea how to fix this wrong example from the manual: https://github.com/nim-lang/Nim/issues/6217 ? |
16:03:00 | * | shashlick quit (Remote host closed the connection) |
16:03:23 | TheLemonMan | you gotta dig into the patterns.nim module to see why it triggers |
16:03:38 | * | shashlick joined #nim |
16:16:15 | * | krako left #nim (#nim) |
16:20:13 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
16:22:19 | FromGitter | <kaushalmodi> I was reading up on term rewriting .. |
16:22:23 | FromGitter | <kaushalmodi> it says "We cannot duplicate 'a' if it denotes an expression that has a side effect! Fortunately Nim supports side effect analysis" |
16:22:24 | FromGitter | <Lite5h4dow> ok, quick question, is there a GUI library for Nim that supports, windows, linux & android? |
16:22:34 | FromGitter | <kaushalmodi> should it be "We should not duplicate 'a' .."? |
16:22:45 | FromGitter | <Lite5h4dow> (and how do i compile for android?) |
16:22:53 | * | shashlick quit (Remote host closed the connection) |
16:23:18 | * | shashlick joined #nim |
16:28:08 | leorize | Lite5h4dow: There is nimx AFAIK |
16:29:37 | Araq | there is also ui.nim |
16:29:46 | FromGitter | <kaushalmodi> trying to understand this term rewriting example: |
16:29:52 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe28ff1c100a4f2961c56a] |
16:30:12 | FromGitter | <kaushalmodi> prints (ignore the colons): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe291482893a2f3bc559dc] |
16:30:26 | FromGitter | <kaushalmodi> why is `3` not an int? |
16:31:00 | narimiran | @kaushalmodi make template return `a+a+a` for easier disambiguation ;) |
16:31:55 | narimiran | does this have to do with: "3 * 2.5" is ok, but "let a = 3; b = 2.5; a * b" is not ok? |
16:32:54 | FromGitter | <kaushalmodi> yep |
16:33:09 | FromGitter | <kaushalmodi> debugEcho helps know if the term rewriting is happening |
16:33:17 | FromGitter | <kaushalmodi> I started reading that section just today |
16:33:30 | FromGitter | <kaushalmodi> I couldn't understand if the term rewriting was happening or not |
16:33:48 | FromGitter | <kaushalmodi> see this other example built up on prev: |
16:33:51 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe29eff659e6777291b83d] |
16:34:07 | FromGitter | <kaushalmodi> that gives: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe29ff3844923661177139] |
16:34:17 | FromGitter | <kaushalmodi> so what's wrong with literal `3`? |
16:38:46 | FromGitter | <kaushalmodi> Also, this example gives a strange result: |
16:38:50 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe2b1a435c2a518e82fcb3] |
16:39:09 | * | Sembei joined #nim |
16:39:19 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe2b37ae7be94016333714] |
16:40:34 | FromGitter | <kaushalmodi> Even if I set x to 0 above, the "-> Term rewriting activated!" gets printed 36 times |
16:40:54 | * | Pisuke quit (Ping timeout: 252 seconds) |
16:41:41 | leorize | it doesn't overflow? I thought that was a recursive term-writing macro |
16:42:13 | FromGitter | <kaushalmodi> hmm, I didn't get any error |
16:42:26 | FromGitter | <kaushalmodi> 36 is some magic number set internally? |
16:44:59 | leorize | you can run a debugger through the compiler to find out :P |
16:45:13 | leorize | s/through/on/ |
16:46:47 | FromGitter | <kaushalmodi> running a debugger goes out of my skill set, but for now, I will note that 36 repetitions is an infinite loop |
16:46:48 | FromGitter | <Lite5h4dow> im getting errors compiling the examples for ui.nim |
16:47:50 | FromGitter | <Lite5h4dow> ```code paste, see link``` ⏎ ⏎ and thats just the last few lines ⏎ gtk3 is installed... [https://gitter.im/nim-lang/Nim?at=5bbe2d35e65a634336b5e6de] |
16:48:22 | leorize | have you installed libui? |
16:49:42 | FromGitter | <Lite5h4dow> its not mentioned as a dependancy |
16:50:06 | FromGitter | <Lite5h4dow> does it not come with the nimble install? |
16:50:11 | leorize | oh yea it can be used directly since it bundled libui already |
16:50:14 | leorize | probably a bug |
16:50:38 | leorize | for now you can install libui |
16:50:53 | FromGitter | <Lite5h4dow> just pakku -S libui? |
16:50:55 | leorize | then pass `-d:useLibUiDll` to the compiler |
16:50:57 | leorize | yes |
16:51:47 | FromGitter | <Lite5h4dow> man, i wish shit would actually work like w/ python or c++ |
16:52:02 | FromGitter | <Lite5h4dow> everything made for nim is badly packaged or half broken |
16:52:42 | Araq | for me that was true for Python and C++ too :-) |
16:53:25 | FromGitter | <Lite5h4dow> well i dont know what packages you were using but i havent had something as bad as a missing dependancy for the actuall package..... |
16:53:39 | leorize | it doesn't miss it |
16:53:46 | leorize | it just didn't compile the thing for some reason |
16:53:55 | FromGitter | <Lite5h4dow> but why... |
16:54:14 | leorize | ask Araq :P |
16:54:41 | Araq | kaushalmodi: it's not an infinite loop, what happens is that diverging rewrite rules get cancelled at some point |
16:55:15 | Araq | probably it would be better to produce a sane error message though :P |
16:56:00 | leorize | Lite5h4dow: I think I know why... |
16:56:25 | leorize | cd into the package folder |
16:56:34 | leorize | `git submodule init; git submodule update` |
16:58:29 | FromGitter | <kaushalmodi> Araq: Cool! how should I describe this issue? |
16:59:11 | FromGitter | <Lite5h4dow> @leorize nice. |
16:59:42 | leorize | Araq: `{.compile: ("./libui/common/*.c", "common_$#.obj").}` this line compiles even when the `libui` folder is empty... is it a bug? |
17:00:35 | * | anamok joined #nim |
17:00:46 | FromGitter | <Lite5h4dow> also, add libui as a required dependency for Linux as well. it will run even if that folder is empty |
17:01:00 | FromGitter | <Lite5h4dow> instead of jsut a footnote |
17:03:03 | leorize | the easier way is to get nimble to actually clone that folder... |
17:06:16 | Araq | leorize: not really, *.c can match 0 files |
17:06:45 | Araq | and I don't care, originally I had precise instructions how to build it and then it was "automated" |
17:07:30 | Araq | and automating a build for an unknown OS setup/environment rarely works |
17:07:31 | FromGitter | <kaushalmodi> It doesn't hurt to add a parameter called "recursive" to .nimble @dom96? |
17:08:00 | FromGitter | <kaushalmodi> then nimble simply need to do `git clone --recurse-submodules FOO` |
17:15:15 | leorize | or maybe all you need to do is to add a task that's executed after `nimble install` |
17:20:46 | * | PMunch joined #nim |
17:21:52 | FromGitter | <Lite5h4dow> i forgot to ask, does this compile to android too? |
17:21:59 | FromGitter | <Lite5h4dow> ui.nim i mean |
17:27:15 | FromGitter | <xmonader> @kaushalmodi well if i've the luxury of time, been thinking to rewrite the whole thing in go now |
17:28:46 | FromGitter | <Lite5h4dow> anyone? |
17:29:40 | FromGitter | <kaushalmodi> @xmonader oh, you are thinking of switching to Go? |
17:30:05 | FromGitter | <xmonader> I've been coding in go for 2 years at least.. |
17:31:34 | Araq | leorize: yeah at least the task can check there are some .c files |
17:31:45 | FromGitter | <kaushalmodi> @xmonader ok, so you started exploring Nim after that.. |
17:31:59 | PMunch | Lite5h4dow: https://github.com/andlabs/libui/issues/35 |
17:32:05 | PMunch | libui doesn't support Android |
17:32:12 | PMunch | But Nim can compile to Android |
17:32:46 | FromGitter | <xmonader> @kaushalmodi I professionally use Python and Go, been trying to push nim a little bit in my current company |
17:33:17 | FromGitter | <kaushalmodi> cool |
17:35:58 | anamok | Is there a REPL for Nim? |
17:36:13 | FromGitter | <xmonader> however, today i was surprised by the fact they expect the current app to work cross platform, in one statically linked binary -thought this part was easy- :D |
17:36:35 | FromGitter | <alehander42> i found out i've considered nim in a "language-to-choose for a tool" report in my prev company in 2016 |
17:36:38 | narimiran | anamok: there's https://github.com/AndreiRegiani/INim |
17:36:54 | FromGitter | <alehander42> but i had no memory of that after when I started actually using nim |
17:37:05 | FromGitter | <kaushalmodi> my start of notes on TRM: https://scripter.co/notes/nim/#term-rewriting-macros |
17:37:36 | anamok | great, thanks |
17:37:58 | FromGitter | <Lite5h4dow> ty @PMunch |
17:38:55 | FromGitter | <alehander42> @anamok there's gonna be a better repl after https://github.com/nim-lang/Nim/issues/8927 |
17:39:14 | FromGitter | <alehander42> eventually |
17:41:16 | FromGitter | <Lite5h4dow> nimx fails to install via nimble |
17:41:18 | FromGitter | <Lite5h4dow> -_- |
17:41:29 | * | SenasOzys joined #nim |
17:41:35 | FromGitter | <Lite5h4dow> idk anymore |
17:42:22 | anamok | narimiran: "nimble install inim" fails |
17:43:05 | narimiran | anamok: yeah, now i see several people have reported that already |
17:43:30 | narimiran | try to do `nimble install inim@#head` and see if it works |
17:43:33 | FromGitter | <kaushalmodi> anamok: inim has that backward incompatible nil string issue |
17:43:42 | FromGitter | <kaushalmodi> narimiran: same issue with that |
17:43:57 | anamok | should i install nim 0.18? |
17:43:58 | narimiran | @kaushalmodi when did you try that? |
17:44:01 | FromGitter | <Lite5h4dow> jnim fails too |
17:44:24 | FromGitter | <kaushalmodi> narimiran: just now |
17:44:31 | narimiran | oh, now i see that the fix is not merged |
17:44:55 | FromGitter | <kaushalmodi> @Lite5h4dow it would be useful to report the nimble install failure in nimx repo |
17:45:09 | FromGitter | <kaushalmodi> there's a slim chance that nimx dev is reading this |
17:45:54 | FromGitter | <Lite5h4dow> its an issue with a dependancy for nimx |
17:46:02 | FromGitter | <Lite5h4dow> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe3adac7bf7c3662eaab9b] |
17:47:05 | FromGitter | <Lite5h4dow> probably a typo thanks to whoever whrote teh nimble file for jnim |
17:47:31 | FromGitter | <Lite5h4dow> (>'-')> |
17:51:02 | FromGitter | <kaushalmodi> Fixing inim was easy |
17:51:07 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/x9dr/image.png) |
17:51:20 | FromGitter | <kaushalmodi> anamok, narimiran: I am sending a PR soon |
17:51:30 | * | Tortice quit (Remote host closed the connection) |
17:51:45 | anamok | that was quick |
17:51:51 | narimiran | :thumb_up: |
17:52:05 | * | Tortice joined #nim |
17:52:07 | FromGitter | <kaushalmodi> you can do this fix locally: |
17:52:11 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe3c4b600c5f642386db41] |
17:52:58 | * | wildlander joined #nim |
17:53:04 | FromGitter | <kaushalmodi> granted that I haven't tested it throughly to check if that preload being "" was ever a valid case |
17:53:20 | FromGitter | <kaushalmodi> but seems to work fine based on brief trial |
17:55:37 | anamok | thanks, I could build it |
17:55:55 | FromGitter | <Lite5h4dow> wait, why is nim still on 0.18 on arch? |
17:56:08 | * | MyMind joined #nim |
17:56:15 | narimiran | because nobody updated it? :P |
17:56:29 | * | Tortice quit (Remote host closed the connection) |
17:56:48 | * | Sembei quit (Ping timeout: 252 seconds) |
17:56:53 | * | Tortice joined #nim |
17:59:10 | FromGitter | <kungtotte> It's a better idea to use choosenim anyway, since it lets you keep multiple toolchains installed and switch between them. |
17:59:16 | narimiran | +1 |
17:59:45 | FromGitter | <Lite5h4dow> screw this, ive spent an entire afternoon for nothing. im going back to c# |
18:00:56 | narimiran | ? |
18:01:13 | * | PrimHelios joined #nim |
18:01:15 | FromGitter | <Lite5h4dow> (the reason nim is still on 0.18 is because 0.19 dosent work on arch....) |
18:01:37 | narimiran | i use manjaro (arch derivative), and 0.19 works just fine |
18:01:48 | FromGitter | <kungtotte> Same here |
18:02:01 | FromGitter | <Lite5h4dow> i updated arch this morning |
18:02:02 | FromGitter | <kungtotte> I install it via choosenim though |
18:02:14 | FromGitter | <Lite5h4dow> nim wasnt on the pakku update list |
18:02:36 | FromGitter | <Lite5h4dow> https://www.archlinux.org/packages/community-testing/x86_64/nim/ |
18:02:47 | FromGitter | <Lite5h4dow> nim 0.19 is still undergoing community testing |
18:02:53 | narimiran | just to `curl https://nim-lang.org/choosenim/init.sh -sSf | sh` and install nim via choosenim and you're ready to go |
18:02:55 | FromGitter | <Lite5h4dow> how do you have 0.19 on arch?!! |
18:03:11 | FromGitter | <Lite5h4dow> ty |
18:03:21 | narimiran | see the details here: https://github.com/dom96/choosenim/ |
18:03:28 | FromGitter | <Lite5h4dow> why isnt this the default install via pacman? |
18:03:35 | FromGitter | <Lite5h4dow> why is everything so segmented? |
18:03:54 | FromGitter | <SolitudeSF> why the hell nim has python as dep on arch? or bash? did someone just randomly put them there? |
18:04:36 | FromGitter | <alehander42> do people really expect the newest 0.x version from os package managers? |
18:04:45 | FromGitter | <Lite5h4dow> yes.... |
18:04:54 | narimiran | @alehander42 in arch: yes |
18:04:59 | FromGitter | <kaushalmodi> @Lite5h4dow just clone and build locally |
18:05:10 | FromGitter | <Lite5h4dow> arch is normally very well maintained with the core packages from my experience |
18:05:31 | FromGitter | <Lite5h4dow> aur not so much |
18:05:53 | FromGitter | <Lite5h4dow> but core normally always stays up to date |
18:06:24 | FromGitter | <alehander42> maybe, i haven't used arch indeed :D |
18:06:54 | narimiran | it is famous for being "bleeding edge" |
18:07:08 | FromGitter | <Lite5h4dow> hence why i run it |
18:08:09 | narimiran | @Lite5h4dow if you want to be on the bleeding edge, then choosenim is the way to go: you can have both stable 0.19 version, and you can easily rebuild every day the newest 0.19.1 devel version |
18:08:35 | FromGitter | <Lite5h4dow> ty |
18:08:55 | FromGitter | <Lite5h4dow> i just get annoyed when things aren't packaged properly. |
18:09:16 | FromGitter | <Lite5h4dow> not many people use my software, but if they do they have all the information they need. |
18:09:20 | FromGitter | <kungtotte> 1) 19 is in community-testing. If you want to be bleeding edge set your repos accordingly... |
18:09:28 | narimiran | well, after you cool down, you should definitely mail the maintainer that he should update nim package ;) |
18:10:09 | FromGitter | <Lite5h4dow> @kungtotte how do you think i found out it didnt work... |
18:10:37 | FromGitter | <Lite5h4dow> will do @narimiran |
18:13:55 | FromGitter | <xmonader> @kaushalmodi with ur article on static deployment ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe4163ae7be9401633eb18] |
18:14:22 | FromGitter | <tim-st> the update for arch is in the testing branch, dont know why: https://www.archlinux.org/packages/community-testing/x86_64/nim/ |
18:15:18 | FromGitter | <kaushalmodi> @xmonader hmm, I haven't used musl with -d:nimDebugDlOpen and pcre |
18:15:39 | FromGitter | <kaushalmodi> (also not sure what that switch does yet) |
18:15:50 | FromGitter | <kaushalmodi> anamok: btw that PR got merged |
18:15:54 | FromGitter | <kaushalmodi> you can install inim from its head |
18:20:52 | FromGitter | <xmonader> @kaushalmodi well that flag was suggested after failing execution ⏎ ⏎ ```could not load: libpcre.so(.3|.1|) ⏎ compile with -d:nimDebugDlOpen for more information``` [https://gitter.im/nim-lang/Nim?at=5bbe4304c7bf7c3662eaf1db] |
18:21:18 | FromGitter | <kaushalmodi> yeah, musl does not have pcre lib as part of it |
18:21:33 | FromGitter | <kaushalmodi> this is outside of my knowledge area |
18:21:53 | FromGitter | <kaushalmodi> somehow you need to get a static lib for pcre and bake that into the nim compiled binary |
18:22:07 | FromGitter | <kaushalmodi> hopefully someone else can chime in |
18:22:28 | FromGitter | <xmonader> pfff it's docopt who requires pcre -_- |
18:23:16 | FromGitter | <kaushalmodi> use cligen! |
18:23:29 | PMunch | Is Nim docopt compile-time? |
18:24:11 | FromGitter | <xmonader> @kaushalmodi cligen doesn't support features needed |
18:24:23 | FromGitter | <xmonader> @PMunch ? |
18:24:54 | FromGitter | <kaushalmodi> which are those? |
18:25:10 | FromGitter | <xmonader> subcommands dispatching. |
18:25:40 | FromGitter | <kaushalmodi> may be I don't understand.. by something like "app sub1 --foo" and "app sub2 --foo"? |
18:26:07 | FromGitter | <xmonader> like ⏎ docker container list ⏎ docker container exec --cmd=X |
18:26:22 | FromGitter | <kaushalmodi> it does |
18:26:51 | FromGitter | <xmonader> No https://github.com/c-blake/cligen/issues/13 |
18:27:48 | FromGitter | <kaushalmodi> understood |
18:28:01 | FromGitter | <kaushalmodi> there's a workaround though |
18:28:21 | FromGitter | <kaushalmodi> you use `seq[string]` and the switches in the first level dispatch commands too |
18:28:40 | FromGitter | <kaushalmodi> when using a for loop over the seq[string] arg, you call the respective command |
18:29:04 | FromGitter | <xmonader> back to docopt then :) |
18:29:19 | FromGitter | <kaushalmodi> yeah :) |
18:29:28 | FromGitter | <kaushalmodi> I see that you are already aware of that workaround |
18:29:33 | FromGitter | <Lite5h4dow> @narimiran is there any way to get choosenim to install nim to /bin? |
18:30:16 | FromGitter | <kaushalmodi> @Lite5h4dow if you are comfortable with bash script, you can look at my custom install script |
18:30:16 | FromGitter | <Lite5h4dow> since the nim VScode plugin dosent support having nim installed to ~/.nimble |
18:30:21 | FromGitter | <xmonader> i am i even tried to hack on the dispatch proc partially worked but was swamped |
18:30:48 | FromGitter | <Lite5h4dow> @kaushalmodi ill give it a look, could you link me? |
18:31:22 | FromGitter | <kaushalmodi> Here: https://ptpb.pw/VD3b/bash |
18:31:35 | FromGitter | <kaushalmodi> you should need to update just line 48 that sets `nim_install_dir` |
18:36:02 | FromGitter | <Lite5h4dow> ty @kaushalmodi ill give it a try |
18:41:54 | * | PrimHelios quit (Ping timeout: 252 seconds) |
18:51:05 | * | PrimHelios joined #nim |
18:51:34 | FromGitter | <mratsim> @kaushalmodi I tried term-rewriting templates in Arraymancer but it was a bit of a hit and miss |
18:52:48 | FromGitter | <mratsim> Like those don’t work: https://github.com/mratsim/Arraymancer/blob/master/src/math_ops_fusion/math_ops_fusion.nim#L32-L42 ⏎ ⏎ But those do: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/optim_ops_fusion.nim#L54-L75 |
18:54:31 | FromGitter | <kaushalmodi> yeah, as I started writing notes to understand TRM, I ended up with a lot of questions |
18:54:58 | FromGitter | <kaushalmodi> I don't understand why many things don't work as I thought I understood its syntax works |
18:55:42 | FromGitter | <kaushalmodi> here's the basic "why?": ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe4b2ec7bf7c3662eb3154] |
18:56:07 | FromGitter | <kaushalmodi> it's not `int{lit}` and still that `echo 3 * 2` doesn't activate TRM |
18:56:30 | FromGitter | <kaushalmodi> it |
18:56:52 | FromGitter | <kaushalmodi> *it's as if that "3 * 2" op finishes before the `*` TRM is checked |
18:57:18 | FromGitter | <xmonader> @kaushalmodi from the brothers in rust https://github.com/emk/rust-musl-builder addresses also openssl |
18:57:24 | FromGitter | <kaushalmodi> trying again: \*it's as if that "3 \* 2" op finishes before the `*` TRM is checked |
18:58:15 | anamok | kaushalmodi, I just read your message. Congrats for the merged PR. |
18:58:28 | FromGitter | <kaushalmodi> @xmonader thanks, though I don't how how to translate that to nim |
18:58:38 | FromGitter | <kaushalmodi> hopefully you or someone else does, and writes about it |
18:58:47 | Araq | as I said, there is not much to understand here, sadly this feature is underdeveloped and the spec is imprecise |
19:03:58 | Araq | but it's awesome and we'll make it work better :P |
19:04:30 | FromGitter | <kaushalmodi> @xmonader I don't understand Docker, but I'd have to guess that https://github.com/emk/rust-musl-builder/blob/master/Dockerfile#L72-L79 needs to be translated to the .travis.yml |
19:04:54 | FromGitter | <kaushalmodi> and "some" switches need to be added to the .nims to fetch that statically built openssl lib |
19:05:05 | * | Trustable quit (Remote host closed the connection) |
19:14:33 | hzx | I finished upgrading iup.nim from 2009 to 2018 |
19:14:47 | hzx | now I have to learn how to make a pull request |
19:17:04 | FromGitter | <kaushalmodi> hzx: that sounds like a sweet update :) |
19:20:29 | * | PMunch quit (Remote host closed the connection) |
19:21:08 | * | rockcavera joined #nim |
19:32:13 | * | tay_ joined #nim |
19:34:57 | * | PrimHelios quit (Ping timeout: 268 seconds) |
19:35:04 | FromGitter | <xmonader> @kaushalmodi yeah think it's bit straightforward |
19:43:20 | * | zachk joined #nim |
19:47:10 | FromGitter | <xmonader> @kaushalmodi ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe573e271506518decaf88] |
19:47:34 | * | niew joined #nim |
19:47:59 | FromGitter | <xmonader> i extracted it from the docker file ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe576fe65a634336b74109] |
19:48:12 | FromGitter | <xmonader> mine is installed at /usr/lib/musl not /usr/local/musl but should be fine |
19:51:46 | FromGitter | <kaushalmodi> @xmonader Thanks! |
19:52:53 | FromGitter | <xmonader> urw, trying now with pcre |
19:54:12 | FromGitter | <kaushalmodi> so that builds libssl.a. Then how is it linked during Nim compilation? |
19:54:22 | FromGitter | <kaushalmodi> what extra switches are needed? |
19:55:03 | FromGitter | <kaushalmodi> or probably no extra switches are needed because the libs live in the musl lib dir? |
19:57:09 | FromDiscord | <An unconspicuous looking friend> are there any templates/macros in stdlibs for getting generic parameters from types? |
19:57:32 | FromGitter | <mratsim> there is a PR, or you can use my macros |
19:57:55 | FromDiscord | <An unconspicuous looking friend> not needed all that much, just wondering if I was missing something |
19:58:01 | FromGitter | <xmonader> @kaushalmodi i believe it's passL:libssl.a |
19:58:04 | FromDiscord | <An unconspicuous looking friend> I just needed to access a single one |
19:58:07 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/pull/8554 |
19:58:34 | FromGitter | <mratsim> or https://github.com/numforge/loop-fusion/blob/master/loopfusion.nim#L3-L12 |
19:59:30 | FromGitter | <mratsim> actually this one is shorter and maybe more generic: https://github.com/mratsim/Arraymancer/blob/master/src/private/ast_utils.nim#L42-L44 |
20:00:36 | FromGitter | <mratsim> but basically do a `getTypeInst` on your input, then do `echo foo.treerepr` and check the index you need to use to get the generic type |
20:01:17 | FromDiscord | <An unconspicuous looking friend> so far this was all I needed: template etype[N, T](a: array[N, T]): type = T |
20:01:30 | FromDiscord | <An unconspicuous looking friend> but thanks for info anyway |
20:01:39 | * | tay_ quit (Ping timeout: 252 seconds) |
20:01:49 | FromGitter | <mratsim> if the subtype is passed as a generic param it’s much easier indead |
20:01:52 | FromGitter | <mratsim> indeed* |
20:02:06 | FromGitter | <xmonader> @kaushalmodi ``` ⏎ crt1.o libc.a libdl.a libpcre32.a libpcrecpp.la libpthread.a libutil.a rcrt1.o ⏎ crti.o libcrypt.a libm.a libpcre32.la libpcre.la libresolv.a libxnet.a Scrt1.o ⏎ crtn.o libcrypto.a libpcre16.a libpcre.a libpcreposix.a librt.a musl-gcc.specs ⏎ engines libc.so libpcre16.la libpcrecpp.a libpcreposix.la libssl.a |
20:02:06 | FromGitter | ... pkgconfig ... [https://gitter.im/nim-lang/Nim?at=5bbe5abef659e6777293420a] |
20:02:46 | FromGitter | <mratsim> in my case I couldn’t because Nim doesn’t have higher kinded type like foo\A, T: seq\[A\ (x: T) |
20:02:47 | planetis[m] | Araq: create another issue? https://github.com/nim-lang/Nim/issues/9263#issuecomment-428705008 |
20:03:29 | * | tay_ joined #nim |
20:03:42 | hzx | First PR in my life :) |
20:05:08 | FromGitter | <xmonader> it worked!!! @kaushalmodi |
20:06:07 | FromGitter | <kaushalmodi> @xmonader 👍 |
20:06:10 | * | MyMind quit (Quit: WeeChat 2.3-dev) |
20:06:15 | FromGitter | <kaushalmodi> please write this up somewhere |
20:06:25 | FromGitter | <kaushalmodi> in nimdays or Nim wiki or as a guest post on Nim site |
20:06:32 | FromGitter | <xmonader> oh god it works! i'm so happy! |
20:07:13 | * | Vladar quit (Remote host closed the connection) |
20:07:28 | FromGitter | <xmonader> @kaushalmodi i'll add it to the issue u created and maybe u can give another look and make it better `scripted` to have a better build? |
20:08:29 | FromGitter | <kaushalmodi> @xmonader probably have a NimScript or something to build the static libs of ssl/pcre and then the app build will use those |
20:09:21 | FromGitter | <xmonader> yeah that's the plan for my tmw :) |
20:15:03 | * | hzx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
20:22:12 | * | narimiran quit (Ping timeout: 252 seconds) |
20:26:06 | FromGitter | <xmonader> Here's an example with statically built against libssl ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bbe605d435c2a518e84b00a] |
20:28:37 | * | niew quit (Quit: Page closed) |
20:30:14 | anamok | bye |
20:30:41 | * | anamok quit (Remote host closed the connection) |
20:35:44 | FromGitter | <xmonader> @Araq despite the passL:libssl.a when i do ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I always hit the else? can you give me some guidance? [https://gitter.im/nim-lang/Nim?at=5bbe62a0600c5f6423880e57] |
20:37:03 | FromGitter | <kaushalmodi> maybe you need explicit `-d:ssl` too? |
20:40:10 | FromGitter | <xmonader> yeah true, indeed! also now i need libcrypto.so :D this is hilarious :D |
20:44:28 | FromGitter | <kaushalmodi> @xmonader https://forum.nim-lang.org/t/4149#25967 |
20:44:38 | FromGitter | <kaushalmodi> I think that's the last thing remaining |
20:47:36 | FromGitter | <xmonader> checking it thank you |
20:53:19 | FromGitter | <xmonader> nim --passL:-static --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc -d:ssl --dynlibOverride:libssl --dynlibOverride:libcrypto --passL:/usr/lib/musl/lib/libssl.a --passL:/usr/lib/musl/lib/libcrypto.a --out:/tmp/dmdm c /tmp/dmdm.nim ⏎ ⏎ Hint: used config file '/home/striky/.choosenim/toolchains/nim-0.19.0/config/nim.cfg' [Conf] ⏎ ⏎ /usr/bin/ld: /home/striky/.cache/nim/dmdm_d/stdlib_openssl.c.o: in function |
20:53:19 | FromGitter | ... `SSL_library_init_jYbJB8dFb3nVeuPiifklXQ': ... [https://gitter.im/nim-lang/Nim?at=5bbe66bebbdc0b25051c0e18] |
20:54:37 | FromGitter | <xmonader> Good night now totally exhausted |
20:57:33 | * | tay_ quit (Ping timeout: 245 seconds) |
21:02:23 | planetis[m] | i dont know will make one and see |
21:02:37 | * | zachk quit (Changing host) |
21:02:37 | * | zachk joined #nim |
21:09:06 | FromGitter | <kaushalmodi> @xmonader I got pcre baked into nims!! |
21:45:45 | * | tay_ joined #nim |
21:45:55 | * | vlad1777d joined #nim |
21:55:32 | * | Jesin quit (Quit: Leaving) |
21:56:41 | FromGitter | <kaushalmodi> how do I pass "-I/path/to/include" to nim? |
21:57:36 | FromGitter | <kaushalmodi> asked here too soon :) --passC |
21:57:48 | * | Jesin joined #nim |
22:00:35 | * | tay_ quit (Quit: Leaving) |
22:09:13 | FromGitter | <kaushalmodi> Some awesome collaboration @xmonader 👍 Now .nims is used like shell script to build pcre statically and then link to it :D |
22:09:44 | FromGitter | <kaushalmodi> Now https://github.com/kaushalmodi/hello_musl/blob/master/config.nims can be used to run "nim musl -d:pcre foo.nim" |
22:24:14 | * | ryuo joined #nim |
22:35:24 | AlexMax | man this is a pain in the neck |
22:35:58 | AlexMax | c2nim seems to think that any use of a special set of identifiers means that --nep1 shouldn't capitalize them |
22:36:58 | AlexMax | not really sure why the exceptions....after all, if a c file is defining its own 'int' (or more likely foo_int that gets truncated) type, it's probably not the same thing as a nim 'int' and should be kept distinct |
22:37:49 | AlexMax | but the more curious thing I'm finding is that one of the identifiers isn't being capitalized |
22:38:46 | AlexMax | nk_cursor is being turned into cursor* |
22:39:06 | AlexMax | even though the structs above and below it are capitalized properly |
22:45:06 | * | krux02 quit (Remote host closed the connection) |
23:11:22 | * | elrood quit (Quit: Leaving) |
23:35:08 | * | platoff quit (Read error: Connection reset by peer) |
23:35:08 | * | Jesin quit (Quit: Leaving) |
23:35:18 | * | SenasOzys quit (Remote host closed the connection) |
23:35:40 | * | SenasOzys joined #nim |
23:35:58 | * | xet7 quit (Remote host closed the connection) |