00:12:52 | * | teimosso joined #nim |
00:12:57 | FromDiscord | <robohack> What is the best way to get input from stdin character by character (don’t wait for new lines)? I also don’t want the typed characters to be automatically echoed so that I can do some things like tab completion. Is getch() the only way? |
00:21:51 | sealmove | robohack |
00:21:58 | sealmove | you probably have to enter raw mode |
00:22:22 | sealmove | https://viewsourcecode.org/snaptoken/kilo/02.enteringRawMode.html |
00:23:41 | sealmove | getting input each time \n appears, and characters echoed, is terminal's doing. So you have to configure that. |
00:25:08 | sealmove | I've done this in Nim specifically before, so you can have this for reference: https://github.com/sealmove/hex/blob/master/editor.nim#L24 |
00:26:57 | sealmove | I used some templates for easier configuration: https://github.com/sealmove/hex/blob/master/header.nim#L99 |
00:29:28 | FromDiscord | <robohack> Awesome, thanks for that. I will check it out. |
00:29:39 | * | endragor quit (Remote host closed the connection) |
00:31:08 | FromDiscord | <robohack> That is what I was looking for! |
00:31:20 | * | teimosso quit (Quit: teimosso) |
00:31:46 | * | teimosso joined #nim |
00:33:08 | * | owl_000 joined #nim |
00:33:39 | * | seni quit (Quit: Leaving) |
01:03:25 | * | abm quit (Quit: Leaving) |
01:16:05 | * | owl joined #nim |
01:18:57 | * | owl_000 quit (Ping timeout: 240 seconds) |
01:21:29 | * | disruptek is now known as hiding_from_the_ |
01:58:51 | * | Jjp137 quit (Read error: Connection reset by peer) |
02:00:14 | * | teimosso quit (Quit: teimosso) |
02:19:27 | sealmove | robohack you're welcome ;) |
02:53:56 | * | go|dfish joined #nim |
02:58:48 | * | rockcavera quit (Remote host closed the connection) |
03:31:05 | * | hiding_from_the_ is now known as disruptek |
03:31:15 | disruptek | damn straight |
03:38:51 | * | theelous3 quit (Ping timeout: 240 seconds) |
03:40:11 | * | theelous3 joined #nim |
03:49:42 | * | sealmove quit (Quit: WeeChat 2.6) |
03:50:43 | * | chemist69 quit (Ping timeout: 245 seconds) |
03:52:48 | * | chemist69 joined #nim |
03:53:55 | * | narimiran joined #nim |
03:56:15 | * | Jjp137 joined #nim |
04:37:57 | * | xace quit (Ping timeout: 245 seconds) |
04:38:22 | * | ehmry quit (Ping timeout: 245 seconds) |
04:38:38 | * | ehmry joined #nim |
04:38:47 | * | livcd quit (Ping timeout: 245 seconds) |
04:40:06 | * | xace joined #nim |
04:45:41 | * | nsf joined #nim |
04:47:44 | * | livcd joined #nim |
05:12:27 | * | minierolls quit (Ping timeout: 240 seconds) |
05:14:51 | * | theelous3 quit (Ping timeout: 240 seconds) |
05:32:50 | * | dddddd quit (Remote host closed the connection) |
05:36:15 | FromDiscord | <crates> does anyone know how to accept a variable number of types in a generic function? say creating a function like 'view' where 'view[type1, type2, type3]()' and 'view[type1, type2]()' would work |
05:37:41 | FromDiscord | <juan_carlos> varargs |
05:46:25 | * | navinmistry joined #nim |
05:47:51 | * | navinmis_ joined #nim |
05:49:43 | FromGitter | <alehander42> you might want to pass them directly |
05:49:50 | * | LargeEpsilon joined #nim |
05:49:51 | FromGitter | <alehander42> like `view(type1, type2, type3)` |
05:50:13 | FromGitter | <alehander42> and use varargs as juan_carlos suggested |
05:50:39 | FromGitter | <alehander42> the type of a type is `type` :P |
05:50:53 | * | navinmistry quit (Ping timeout: 250 seconds) |
05:51:58 | FromDiscord | <crates> cheers I'll give it a shot |
06:02:46 | FromGitter | <nickdex> Hello everyone, I recently picked up nim and am using it for contributing to Cosmos (https://github.com/OpenGenus/cosmos) repo. For building a proc to calculate average, I was wondering if I could use generics to ensure only sequence of numeric values could be passed to my proc. Can anyone point me where/what should I start reading? For my I accepting all types and manually checking if its either float or int. |
06:03:26 | Araq | something like proc p[T: SomeNumber](values: openArray[T]) |
06:03:50 | Araq | alehander42: the type of a type is actually 'typedesc' |
06:03:58 | * | FromGitter quit (Remote host closed the connection) |
06:04:16 | * | FromGitter joined #nim |
06:06:10 | * | solitudesf joined #nim |
06:08:20 | FromGitter | <alehander42> yes, you can use `or` |
06:08:52 | FromGitter | <alehander42> there are many builtin combos already |
06:09:00 | FromGitter | <alehander42> but they all use `or` |
06:09:24 | FromGitter | <alehander42> look at https://github.com/nim-lang/Nim/blob/devel/lib/system.nim#L91 |
06:09:41 | FromGitter | <alehander42> one of those |
06:09:45 | FromGitter | <alehander42> maybe SomeNumber? |
06:14:00 | FromGitter | <alehander42> hm, sorry, if you want to pass "sequence" tho, this might not work |
06:14:31 | FromGitter | <alehander42> as you can't really create a sequence of A|B |
06:17:38 | FromGitter | <alehander42> just use float honestly: it seems most other impl just use this or int |
06:23:05 | * | PMunch joined #nim |
06:48:34 | * | skoude joined #nim |
06:53:27 | * | navinmis_ quit (Remote host closed the connection) |
06:57:50 | * | skoude quit (Ping timeout: 276 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:05:05 | * | gmpreussner joined #nim |
07:09:08 | * | navinmistry joined #nim |
07:13:24 | * | navinmistry quit (Ping timeout: 252 seconds) |
07:13:55 | Zevv | 'moin #nim. I recently had some need of benchmarking stuff at compile time, but there is no API avaible for telling time in the VM. A similar thing just came up in the forum, so maybe it would make sense to implement some bare necessities to support this. |
07:15:35 | * | Vladar joined #nim |
07:17:06 | Zevv | clock() is a poor interface, but it's likely to be the most portable method available. Would it make sense to add this to the VM? |
07:21:37 | * | tdc quit (Ping timeout: 240 seconds) |
07:25:28 | PMunch | Zevv, hmm how does the compiler grab the timestamp of it's compilation time? Is that just a staticExec to something? |
07:25:50 | Zevv | not sure, but good point |
07:27:22 | FromGitter | <alehander42> the compiler runs runtime code |
07:27:37 | FromGitter | <alehander42> or is that a different timestamp? |
07:28:06 | PMunch | I'm talking about the timestamp in "nim --version" that shows the date it was compiled on |
07:28:34 | Zevv | Doesn't the compiler also check current time vs file mtime, and things like that? |
07:28:40 | FromGitter | <alehander42> ah sorry |
07:28:45 | Zevv | Ah nevermind, that's nonsense |
07:29:21 | Zevv | I think we just need posix/ansi C clock() and maybe clock_gettime(), but that will need all kind of other implementations for other platforms |
07:29:32 | Zevv | clock() is a low hanging fruit and is probably ok for basic profiling |
07:32:12 | FromGitter | <alehander42> so indeed this was a good question |
07:33:52 | Zevv | yes, but what is the *answer*? :) |
07:35:02 | FromGitter | <alehander42> the compiler seems to calculate "CompileDate" from getDateStr |
07:35:09 | FromGitter | <alehander42> and put this in the final source |
07:36:53 | FromGitter | <alehander42> getTime* |
07:37:29 | Zevv | yeah but the compiler doesn't do that at compile time right |
07:37:43 | * | Zevv scratches his head a bit |
07:37:48 | PMunch | It can't, getDateStr uses "clock_gettime" on Linux |
07:38:02 | Zevv | sure, it's available there, but not in the VM |
07:38:07 | Zevv | which is the point. |
07:38:19 | FromGitter | <alehander42> but guys |
07:38:21 | FromGitter | <alehander42> the compiler |
07:38:23 | FromGitter | <alehander42> runs at runtime |
07:38:31 | FromGitter | <alehander42> like |
07:38:39 | FromGitter | <alehander42> the compiler code is not CompileTime code |
07:39:18 | Zevv | that's what I ment :) |
07:39:27 | FromGitter | <alehander42> we're talking about the nim compiler itself |
07:39:32 | Zevv | right :) |
07:39:33 | PMunch | Aha, CompileDate is a compiler magic.. |
07:39:37 | FromGitter | <alehander42> yes |
07:39:52 | Zevv | so my proposal is to add cpuTime() magic |
07:40:24 | PMunch | alehander42, yes but the compiler itself has the time it was compiled in it. So it must at some point get that time when it's compiling itself |
07:40:24 | FromGitter | <alehander42> yeah i see what you mean, that one would be able to const COMPILE_TIME = cpuTime() etc |
07:40:42 | FromGitter | <alehander42> but that's while its running |
07:41:42 | FromGitter | <alehander42> the compiler on its runtime gets getTime(), while its semchecking CompileDate and replaces it in the final AST with a string node |
07:41:49 | Zevv | exactly. |
07:42:00 | FromGitter | <alehander42> but yeah, a time vm primitive would be better probably |
07:42:03 | Zevv | so lets talk about 'vm' or 'native' instead of 'compile time' |
07:42:14 | FromGitter | <alehander42> yeah, its very confusing :P |
07:42:22 | FromGitter | <alehander42> btw PMunch, so what |
07:42:32 | FromGitter | <alehander42> we share a room with the minimalistic langs? |
07:43:02 | FromGitter | <alehander42> i guess that means a talk or two for our langs? |
07:43:13 | * | navinmistry joined #nim |
07:47:28 | * | tdc joined #nim |
07:51:17 | PMunch | Yeah we went from our proposed half-day room to sharing a full day with the Minimalistic Languages room |
07:51:53 | PMunch | Last year they had 17 talks |
07:52:20 | PMunch | Most in the 20-30 minute range |
07:52:51 | PMunch | https://archive.fosdem.org/2019/schedule/track/minimalistic_languages/ <- Last year |
07:53:00 | FromGitter | <alehander42> so we can squeeze ~2 i guess |
07:53:02 | FromGitter | <alehander42> maybe |
07:53:17 | FromGitter | <alehander42> but yeah, its actually a |
07:53:38 | FromGitter | <alehander42> new submission form, so maybe there are other langs |
07:54:13 | PMunch | I mean it really depends on how many talks that gets proposed |
07:54:22 | FromGitter | <alehander42> we can propose 50 |
07:54:25 | FromGitter | <alehander42> just look at our RFC-s |
07:54:49 | PMunch | Haha, be my guest :) |
07:55:08 | PMunch | I mean you don't realy have to actually write the talk until after its accepted |
07:57:06 | PMunch | Okay, so they wanted a 1 day room, we asked for 0.5 day. Condensing that down to 1 day means 0.75 for "them" and 0.25 for "us" (I really don't like to distinguish, we're supposed to work together after all) means 17 talks/day * 0.25 days = 4.25 talks |
07:58:23 | * | livcd quit (Changing host) |
07:58:23 | * | livcd joined #nim |
08:02:38 | FromGitter | <raydf> Is there any plan for widget based UI macros framework, like Flutter but with Nim instead of Dart? |
08:03:43 | * | shomodj joined #nim |
08:05:50 | PMunch | raydf, what do you mean by "widget based UI macros framework"? |
08:06:03 | * | owl quit (Ping timeout: 240 seconds) |
08:13:15 | * | skoude joined #nim |
08:15:56 | * | owl joined #nim |
08:18:12 | * | asymptotically joined #nim |
08:20:02 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:21:37 | * | skoude quit (Ping timeout: 240 seconds) |
08:25:20 | * | floppydh joined #nim |
08:42:13 | * | ng0 joined #nim |
08:50:23 | FromGitter | <nickdex> @alehander42 Thanks for that I didn't knew we can use `or`, kinda like TypeScript. I'll experiment with SomeNumber, sound like a good fit. My first impl was with float, then I started thinking about making it generic, might just create PR with float in end if it doesn't work out |
08:52:05 | * | krux02 joined #nim |
08:52:41 | * | tdc quit (Read error: Connection reset by peer) |
08:54:17 | * | krux02 quit (Read error: Connection reset by peer) |
08:56:29 | FromGitter | <alehander42> yeah, the issue is that you can't really create a "generic" sequence in non-generic code |
09:06:23 | * | navinmis_ joined #nim |
09:07:18 | * | navinmis_ quit (Remote host closed the connection) |
09:08:56 | * | tdc joined #nim |
09:10:16 | * | navinmistry quit (Ping timeout: 264 seconds) |
09:11:44 | * | navinmistry joined #nim |
09:14:41 | skrylar[m] | @awr1 i thought rust was interesting, though the compile times were so bad i swear whatever the borrow checker saved me i lost in waiting for compiles :p |
09:15:51 | * | asymptotically quit (Quit: Leaving) |
09:17:41 | FromDiscord | <Rika> rust has pretty quick compile times now afaik |
09:20:27 | * | navinmistry quit (Remote host closed the connection) |
09:20:27 | FromDiscord | <Rika> do `ref object`s need `=destroy`s? |
09:22:37 | PMunch | Are you using --newruntime? |
09:22:58 | PMunch | With the default garbage collecter you don't need =destroy |
09:23:12 | * | krux02 joined #nim |
09:25:48 | livcd | Rika: really ? where I can read about it ? |
09:27:56 | FromDiscord | <mratsim> ref objects have no destroy anyway |
09:28:23 | FromDiscord | <mratsim> if you want specific behaviour on ref object end of life you can use finalizers |
09:36:41 | * | abm joined #nim |
09:42:01 | FromDiscord | <Rika> okay |
09:42:52 | FromDiscord | <Rika> uh |
09:43:00 | FromDiscord | <Rika> how exactly do i make a finalizer >_< |
09:43:11 | * | birdspider joined #nim |
09:43:45 | FromGitter | <alehander42> do you need it ? |
09:44:06 | FromGitter | <alehander42> i mean, do you want to do something specific when its collected |
09:45:18 | FromDiscord | <Rika> yes |
09:45:22 | FromDiscord | <Rika> close a dbconn |
09:47:14 | FromGitter | <alehander42> iirc you need to write it like https://forum.nim-lang.org/t/1652 |
09:48:58 | * | Perkol joined #nim |
09:49:03 | * | skoude joined #nim |
09:49:19 | FromGitter | <alehander42> but i'd use something like context manager template or similar, not sure if finalizers are better fit |
09:49:23 | FromGitter | <alehander42> depends on the case |
09:53:47 | * | fichtl quit (Ping timeout: 245 seconds) |
09:54:14 | FromDiscord | <Rika> it's gonna be an object that's gonna be passed around a lot i guess |
09:57:35 | FromDiscord | <Kiloneie> I think that part where youtube detects if you say like and subscribe might hold some weight, but it's impossible to say with a single sample size(#8 surpased #7, which none other video has) |
09:58:30 | FromDiscord | <Rika> there are a lot of factors |
09:58:57 | FromDiscord | <Kiloneie> Yeah imma wait for a bigger sample to confirm it |
09:59:28 | FromDiscord | <Kiloneie> YouTube does do a lot of shady stuff that they don't tell you, you only hear about it from other YouTubers that are already big and actually get news from staff. |
10:00:29 | FromDiscord | <djazz> If Manning didnt ship the book (Nim in Action) with FedEx I would have it now. |
10:01:44 | narimiran | there you go again, obsessing about meaningless numbers :D |
10:02:02 | FromDiscord | <Kiloneie> Shush.... mute. |
10:02:42 | FromGitter | <alehander42> i figured out nim thought most of my single example files are in package |
10:02:50 | FromGitter | <alehander42> because i have <myusername>.nimble |
10:02:53 | FromGitter | <alehander42> in my home dir |
10:02:58 | FromGitter | <alehander42> what am i doing |
10:04:44 | FromDiscord | <Rika> you coulda just typed your username in gitter rather than <myusername> |
10:06:33 | FromDiscord | <Kiloneie> Is SDL2_gfx a thing made by Vladar4 ? |
10:06:33 | FromDiscord | <Kiloneie> Is this the official way of obtaining it trough a dropbox ?: https://github.com/Vladar4/sdl2_nim/blob/master/LINKS.md |
10:08:41 | * | navinmistry joined #nim |
10:13:16 | * | navinmistry quit (Ping timeout: 264 seconds) |
10:13:57 | FromDiscord | <Kiloneie> Where are nimble packages installed to (on windows 10) ? or where can i find this information ? |
10:14:03 | * | skoude quit (Ping timeout: 240 seconds) |
10:14:42 | narimiran | `nimble path` |
10:14:50 | narimiran | https://github.com/nim-lang/nimble/#nimble-path |
10:15:34 | narimiran | why am i reading readme for you? |
10:15:50 | FromDiscord | <Kiloneie> Sorry, i must have went over it |
10:20:54 | * | solitudesf quit (Ping timeout: 265 seconds) |
10:21:17 | * | sedfox quit (Ping timeout: 240 seconds) |
10:23:02 | * | sedfox joined #nim |
10:23:24 | FromGitter | <alehander42> rika, well not really : if i just say `al` its not obvious this is my user name |
10:23:46 | FromGitter | <alehander42> but you're right that actually it doesnt matter if its my user name, <anyident>.nimble seems to lead to the same |
10:38:40 | FromDiscord | <Kiloneie> That's a lot of DLLs required for making games with it oO |
10:38:43 | * | shomodj joined #nim |
10:39:16 | * | shomodj quit (Client Quit) |
10:39:18 | FromDiscord | <Kiloneie> Not much different than how most AAA games directories look like actually xD, a clusterfuck of dlls. |
10:39:41 | narimiran | wait, are you considering making a game for some of the next videos? |
10:39:50 | * | skoude joined #nim |
10:39:59 | narimiran | from "how to write if statement" to games might be quite a leap :D |
10:40:13 | * | shomodj joined #nim |
10:40:14 | FromDiscord | <Kiloneie> I am thinking of trying to mixing it |
10:41:04 | FromDiscord | <Kiloneie> install git, sdl2, show them a simple sdl2 program, explain as best i can, only the actual code not the army of procedures on the top, then teach loops etc from there... maybe... |
10:41:15 | FromDiscord | <Kiloneie> gotta figure out first how difficult this will be |
10:47:29 | FromDiscord | <Kiloneie> Probably not for today's video yet, gotta plan what things i gotta teach before SDL2 |
10:51:45 | planetis[m] | I have a question about custom pragmas. So when the code (type section, proc, etc) is type checked, the pragmas are stripped right? Meaning I can't get them from a typed macro? |
10:55:38 | FromDiscord | <Kiloneie> Yeah not today. They gotta learn a bit more first, gotta make it more entertaining though. |
10:56:54 | narimiran | agreed about 'more entertaining'. maybe you can now make some small program, based on the stuff you showed already |
10:57:24 | narimiran | and then after 5-6 more videos, once again some interesting example using those skills, etc. |
10:57:41 | * | skoude quit (Ping timeout: 276 seconds) |
11:07:04 | * | ee7[m] quit (Remote host closed the connection) |
11:07:08 | * | Miguelngel[m] quit (Remote host closed the connection) |
11:07:08 | * | nergal[m] quit (Read error: Connection reset by peer) |
11:07:09 | * | zielmicha[m]1 quit (Remote host closed the connection) |
11:07:11 | * | isaac[m]1 quit (Read error: Connection reset by peer) |
11:07:22 | * | Connor[m] quit (Read error: Connection reset by peer) |
11:07:23 | * | BitPuffin quit (Read error: Connection reset by peer) |
11:07:24 | * | xomachine[m] quit (Read error: Connection reset by peer) |
11:07:28 | * | muxueqz[m] quit (Read error: Connection reset by peer) |
11:07:28 | * | pigmej quit (Remote host closed the connection) |
11:07:29 | * | GitterIntegratio quit (Read error: Connection reset by peer) |
11:07:31 | * | k0mpjut0r quit (Read error: Connection reset by peer) |
11:07:37 | * | Demos[m] quit (Read error: Connection reset by peer) |
11:07:38 | * | LEdoian[m] quit (Read error: Connection reset by peer) |
11:07:38 | * | meff[m] quit (Read error: Connection reset by peer) |
11:07:42 | * | planetis[m] quit (Read error: Connection reset by peer) |
11:07:42 | * | gh0st[m] quit (Read error: Connection reset by peer) |
11:07:42 | * | encryptize[m] quit (Read error: Connection reset by peer) |
11:07:42 | * | nc-x[m] quit (Read error: Connection reset by peer) |
11:07:43 | * | leorize[m] quit (Remote host closed the connection) |
11:07:43 | * | spymasterd[m] quit (Remote host closed the connection) |
11:07:44 | * | macsek1911[m] quit (Read error: Connection reset by peer) |
11:07:44 | * | lqdev[m] quit (Read error: Connection reset by peer) |
11:07:44 | * | narimiran[m] quit (Remote host closed the connection) |
11:07:45 | * | skrylar[m] quit (Read error: Connection reset by peer) |
11:07:45 | * | jaens[m] quit (Read error: Connection reset by peer) |
11:07:45 | * | testgovno[m] quit (Remote host closed the connection) |
11:07:45 | * | Kameleon quit (Remote host closed the connection) |
11:07:46 | * | yglukhov[m] quit (Write error: Connection reset by peer) |
11:07:46 | * | MrAxilus quit (Remote host closed the connection) |
11:07:46 | * | TheManiac[m] quit (Remote host closed the connection) |
11:07:47 | * | ronny quit (Write error: Connection reset by peer) |
11:08:14 | * | daddoo joined #nim |
11:10:46 | FromDiscord | <Kiloneie> I was planning a simple calculator |
11:14:10 | FromGitter | <alehander42> sounds ok! |
11:17:39 | * | Vladar quit (Remote host closed the connection) |
11:18:11 | * | planetis[m] joined #nim |
11:26:59 | * | Perkol quit (Remote host closed the connection) |
11:39:15 | FromDiscord | <Rika> me being dumb again; any docs for how functional programming works on nim? |
11:40:42 | PMunch | Depends on what you mean by functional programming |
11:40:53 | PMunch | A lot of the concepts are just there in Nim |
11:41:35 | PMunch | You can also use `func` instead of `proc` to create a procedure that is guaranteed to be side-effect free |
11:42:00 | * | Demos[m] joined #nim |
11:42:00 | * | BitPuffin joined #nim |
11:42:00 | * | TheManiac[m] joined #nim |
11:42:00 | * | Connor[m] joined #nim |
11:42:00 | * | LEdoian[m] joined #nim |
11:42:00 | * | k0mpjut0r joined #nim |
11:42:00 | * | isaac[m]1 joined #nim |
11:42:00 | * | gh0st[m] joined #nim |
11:42:00 | * | GitterIntegratio joined #nim |
11:42:01 | * | leorize[m] joined #nim |
11:42:01 | * | jaens[m] joined #nim |
11:42:01 | * | ronny joined #nim |
11:42:01 | * | MrAxilus joined #nim |
11:42:01 | * | nergal[m] joined #nim |
11:42:01 | * | lqdev[m] joined #nim |
11:42:02 | * | pigmej joined #nim |
11:42:07 | * | macsek1911[m] joined #nim |
11:42:07 | * | ee7[m] joined #nim |
11:42:07 | * | xomachine[m] joined #nim |
11:42:07 | * | narimiran[m] joined #nim |
11:42:07 | * | spymasterd[m] joined #nim |
11:42:07 | * | yglukhov[m] joined #nim |
11:42:07 | * | Miguelngel[m] joined #nim |
11:42:07 | * | encryptize[m] joined #nim |
11:42:08 | * | muxueqz[m] joined #nim |
11:42:08 | * | skrylar[m] joined #nim |
11:42:08 | * | testgovno[m] joined #nim |
11:42:08 | * | Kameleon joined #nim |
11:42:08 | * | zielmicha[m]1 joined #nim |
11:42:08 | * | meff[m] joined #nim |
11:42:09 | * | nc-x[m] joined #nim |
11:42:34 | PMunch | Or something like https://github.com/zero-functional/zero-functional to do zero-cost chaining for a more typical functional workflow |
11:44:17 | FromDiscord | <Rika> i just cant seem to figure out how to store a function with a varargs in a variable/object |
11:44:26 | FromDiscord | <Rika> am getting `Error: expected: ')', but got: '['` |
11:44:36 | Zevv | pastebin your code |
11:45:03 | FromDiscord | <Rika> 1 sec |
11:46:06 | FromDiscord | <Rika> https://gist.github.com/de-odex/38425fbbbfdb59428e7015abfbb06444 i have NO idea if im doing anything right |
11:47:44 | Zevv | your arguments need names |
11:48:21 | FromDiscord | <Rika> what they do? |
11:48:22 | FromDiscord | <Rika> damn |
11:48:23 | FromDiscord | <Rika> okay |
11:49:02 | PMunch | Yup, with names it works just as you would expect: https://play.nim-lang.org/#ix=1Pcm |
11:49:17 | Zevv | http://ix.io/1PcI |
11:49:41 | Zevv | ha funny I got a race condition from ix.io, "key already exists" |
11:49:49 | Zevv | must have been your paste PMunch |
11:49:52 | FromGitter | <alehander42> x, y vs a, b |
11:49:59 | FromGitter | <alehander42> the battle of example parameters |
11:50:07 | Zevv | hehe |
11:50:07 | FromDiscord | <Rika> i use n m |
11:50:08 | PMunch | Zevv, huh, might be |
11:50:11 | FromGitter | <alehander42> i also use a,b |
11:50:12 | FromGitter | <alehander42> usually |
11:50:36 | PMunch | a, b makes more sense I guess. Then you can go on for longer.. |
11:50:54 | Zevv | I was just about to leave the Nim community because the bad music taste the other day, but now I found my a,b soulmate I should probably stay |
11:51:17 | Zevv | I once picked up the as, bs for lists, dont remeber from what language, but I like that also |
11:51:24 | Zevv | for a in as: |
11:51:24 | shashlick | @Araq gorge fails on osx after a few calls - http://ix.io/1NNL |
11:51:43 | PMunch | Zevv, bad music taste? |
11:51:57 | FromGitter | <alehander42> haskell probably |
11:52:08 | Zevv | According to araq I was the only one critiquing the music of his viral video :) |
11:52:45 | FromGitter | <alehander42> you just dont get it zevv |
11:53:00 | Zevv | alehander42: well, at least I picked up *something* from haskell then |
11:53:43 | Zevv | @Rika: you good now? |
11:54:18 | FromGitter | <alehander42> Zevv you can now write "this codebase is inspired by haskell" |
11:54:30 | FromGitter | <alehander42> the same way bands write "inspired by u2" |
11:54:50 | PMunch | Zevv, viral video? How much have I missed :P |
11:55:08 | Zevv | PMunch: depends on your music taste I guess |
11:55:16 | Zevv | check the forum |
11:55:49 | Zevv | I must admit Haskell did a good thing opening some parts of my brain I didnt know I had |
11:56:11 | Zevv | I later wachted three quarters of the Sussman lisp lectures, that was more of a brain opener though |
11:56:17 | * | clyybber joined #nim |
11:56:42 | FromGitter | <alehander42> i want to checkout ML/ocaml sometime this year |
11:57:12 | Zevv | I'm having a hard time choosing this hears AoC language |
11:57:22 | Zevv | Nim was 2019's |
11:58:38 | Zevv | should I do rust? I could use some C++ practice but I don't like that. Ocaml is on the list. choices, choices |
11:59:24 | Zevv | I'm officially an embedded and systems programmer, and I still have not properly started my rust career. Will that turn out to be a mistake one day? |
11:59:50 | Zevv | BUt then again, I got away with ignoring C++ up to now as well, so I'm good :) |
12:01:09 | narimiran | Zevv: this year is 2019 |
12:01:19 | narimiran | so nim it is? :D |
12:01:40 | Zevv | o right 2019 still, dang |
12:01:48 | Zevv | 2018 sounds sooo 2017 |
12:01:53 | livcd | Zevv: try with Min |
12:02:12 | Zevv | ha |
12:02:28 | Zevv | I guess I have to make npeg turing complete then |
12:04:09 | narimiran | Zevv: fwiw, i plan to do this year AoC in Nim + Ocaml |
12:04:31 | narimiran | you should pick it too, so we can compare solutions :) |
12:04:38 | FromGitter | <zetashift> Jumped ship from F# to OCaml huh narimiran!? |
12:04:42 | narimiran | (i'm an ocaml beginner) |
12:04:56 | narimiran | zetashift: yeah, ocaml is easier for me on linux |
12:05:37 | FromGitter | <zetashift> even with .NET Core 3? |
12:06:18 | FromGitter | <zetashift> (I tried ReasonML but the tooling on windows isn't quite there yet). I really liked the language though |
12:06:25 | FromGitter | <zetashift> Kinda miss operator overloading though |
12:07:00 | FromGitter | <alehander42> i might also use ocaml |
12:07:02 | FromGitter | <alehander42> when is AoC |
12:07:19 | narimiran | i managed to set up nvim quite nicely for ocaml, so even with .net core 3, i'll stick with ocaml for now |
12:07:25 | narimiran | Dec 1st – Dec 25th |
12:08:10 | FromGitter | <zetashift> The languages don't differ that much anyway so enjoy :D |
12:08:37 | * | tklohna quit (Ping timeout: 240 seconds) |
12:09:03 | FromGitter | <alehander42> ty |
12:09:35 | FromDiscord | <Rika> what does it mean for a proc to be GC-safe |
12:09:47 | narimiran | yeah, i miss some things from F# (e.g. either there is no `yield` or i just didn't find it), but otherwise they are quite similar. i like ocaml so far |
12:13:08 | * | skoude joined #nim |
12:14:28 | * | krux02 quit (Ping timeout: 245 seconds) |
12:15:11 | Zevv | Rika: pracitally, it should not use global data |
12:17:07 | FromDiscord | <Rika> okay, solved the warning i got. the proc in the object has to be gcsafe too |
12:17:34 | * | sacredfrog joined #nim |
12:18:01 | * | sacredfrog quit (Client Quit) |
12:18:51 | FromDiscord | <has1> hi, i think i asked this already |
12:18:54 | * | sacredfrog joined #nim |
12:19:24 | FromDiscord | <has1> but what would be the equivalent of a go "map" in nim? |
12:19:38 | FromGitter | <alehander42> Table |
12:19:42 | Zevv | What is a "map" in go? :) |
12:19:51 | narimiran | has1: https://nim-lang.github.io/Nim/tables.html |
12:20:11 | Zevv | has1: var t: Table[A, B], where A and B are your Favourite Types |
12:20:17 | Zevv | and do 'import tables' |
12:22:02 | FromDiscord | <has1> ah great, that seems to be what I want, thanks! |
12:25:00 | FromDiscord | <Rika> is there a reason theyre called tables instead of maps or dicts or whatever other name? im just curious, hopefully i aint starting a war |
12:25:32 | FromDiscord | <has1> that is an interesting question, and i was looking for an answer to this too |
12:25:36 | FromDiscord | <has1> https://en.wikipedia.org/wiki/Hash_table |
12:25:56 | narimiran | because wikipedia says so? https://en.wikipedia.org/wiki/Hash_table :P |
12:26:07 | narimiran | ah, you were faster |
12:26:16 | FromDiscord | <juan_carlos> map sounds like map of map() of mapping a func to args. |
12:26:24 | FromDiscord | <Rika> good points |
12:26:42 | narimiran | ...and dict sounds like a dick |
12:26:58 | FromDiscord | <Rika> how vulgar |
12:27:04 | FromDiscord | <Rika> i kid, i kid |
12:27:37 | Zevv | 'dicts' are often ment for string -> T mapping |
12:27:41 | FromDiscord | <Kiloneie> some things are hard to let go after getting them hammered into your head |
12:27:47 | Zevv | tables are more generic: every T you can hash, you can use as a key in a Table |
12:28:01 | FromDiscord | <Rika> are you referring to me neie? |
12:28:43 | FromDiscord | <Kiloneie> well it takes me a few seconds to remember what tables are in other languages. and to all of you |
12:28:53 | FromDiscord | <Rika> i dont really have it hammered into my head, because i programmed a tiny bit in lua before, which broke my habit of calling tables dicts before nim |
12:29:01 | FromDiscord | <Rika> so thankfully no need to go through that again |
12:29:08 | clyybber | Araq: Since you marked https://github.com/nim-lang/Nim/issues/12282 as easy, care to give me a pointer? |
12:29:28 | FromDiscord | <Kiloneie> i only used dictionaries in Godot, never used them before, so it shouldn't be too hard to scrap that naming |
12:29:46 | FromDiscord | <juan_carlos> culon Nim type on Spanish kinda means fat-ass BTW. |
12:31:00 | FromDiscord | <Kiloneie> well it is fat in content |
12:31:37 | FromDiscord | <mratsim> is go map a hashtable? in that case "import tables" and use Table, OrderedTable TableRef @has1 |
12:32:02 | narimiran | IE has entered the building :D |
12:32:19 | FromDiscord | <mratsim> oops, discord refresh is slow :/ |
12:32:55 | FromDiscord | <has1> @mratsim thanks though 🙂 |
12:33:01 | * | owl quit (Quit: Leaving) |
12:33:11 | FromDiscord | <has1> I just wanted to try this out |
12:33:33 | FromDiscord | <has1> ah, i was about to post a 6 line code snippet in here |
12:34:22 | FromDiscord | <has1> Just before i remembered that everyone is going to freak out from IRC 😄 |
12:34:31 | FromDiscord | <has1> I really like this though |
12:34:31 | FromDiscord | <has1> https://play.nim-lang.org/#ix=1PZf |
12:34:59 | Zevv | has1: we trained you well I see |
12:35:48 | Zevv | has1: surprise: https://play.nim-lang.org/#ix=1PZs |
12:36:00 | FromDiscord | <Rika> oh yeah |
12:36:03 | FromDiscord | <Rika> that's odd too |
12:36:10 | Zevv | :) |
12:36:19 | FromDiscord | <Rika> why can there be multiple keys? are strings not hAsH wHeN value? |
12:36:21 | FromDiscord | <Rika> oops |
12:36:23 | narimiran | moral of the story: don't use `add` |
12:36:25 | Zevv | Nim tables are a bit, ehm, 'special' |
12:36:35 | Zevv | use t.data["test"] = |
12:36:36 | narimiran | use `myTable[key] = value` |
12:36:41 | FromDiscord | <Rika> *`==` in hash when `==` in value |
12:36:45 | FromDiscord | <has1> wait what |
12:36:45 | FromDiscord | <has1> LOL |
12:37:13 | lqdev[m] | the docs mention this behavior, though |
12:37:30 | FromDiscord | <Rika> is accessing a missing key safe or doesnt throw an exception? |
12:37:34 | FromDiscord | <has1> thats actually stupid, no offense |
12:37:42 | Zevv | has1: if you ever feel the need to get confused, ask us, we're always here for you |
12:37:42 | FromDiscord | <has1> isn't that the entire point about a hash table? |
12:37:43 | lqdev[m] | it throws |
12:37:53 | narimiran | has1 there is a reason why it is the way it is |
12:38:04 | narimiran | i wanted to remove it, but Araq likes this feature |
12:38:08 | FromDiscord | <Rika> what's the reason? |
12:38:13 | lqdev[m] | a KeyError, to be exact @Rika |
12:38:22 | FromDiscord | <has1> yeah, what is the reason?? |
12:38:31 | narimiran | Rika: you can easily try that yourself ;) |
12:38:36 | FromDiscord | <Rika> lazy |
12:38:40 | FromDiscord | <Rika> 😛 |
12:38:47 | FromDiscord | <Rika> it's solved now anyway |
12:38:58 | FromDiscord | <Rika> now that i think of it it's a dumb question |
12:39:18 | FromDiscord | <Rika> anyway why is add the way it is? |
12:39:36 | narimiran | so you can have multiple values for the same key. obviously :P |
12:40:01 | narimiran | lazy to explain, lol :P |
12:40:02 | FromDiscord | <Rika> but you cant access the other one w/o some kinda fuckery can you? |
12:40:02 | FromDiscord | <has1> i was going to applaud nim, because in Go adding something to a nil map panics |
12:40:03 | * | owl_000 joined #nim |
12:40:06 | FromDiscord | <Rika> oof nice |
12:40:08 | FromDiscord | <has1> you have to initialize the map first |
12:40:30 | narimiran | has1 yours truly has implemented that, btw ;) |
12:40:45 | FromDiscord | <has1> but the fact that the table can have duplicate keys ruins the applause LOL |
12:40:59 | FromDiscord | <Rika> OOT: go's interface{} scares me |
12:41:00 | FromDiscord | <Rika> anyway |
12:41:03 | PMunch | Yeah that is really strange.. |
12:41:18 | narimiran | it is documented (https://nim-lang.github.io/Nim/tables.html#add%2CTableRef[A%2CB]%2CA%2CB) but nobody reads documentation nowadays |
12:41:20 | PMunch | Is there a way to get the "surprise" value back? |
12:41:30 | FromDiscord | <has1> @Rika you dont have to use it though 🙂 |
12:41:37 | PMunch | I mean it's fine that it's documented, but why does it even exist? |
12:42:02 | narimiran | Rika: accessing "some kinda fuckery": https://nim-lang.github.io/Nim/tables.html#allValues.i%2CTable[A%2CB]%2CA |
12:42:07 | FromDiscord | <has1> seriously.. this is such unexpected behavior |
12:42:09 | PMunch | Oh, if you del the key you get the second value.. |
12:42:27 | narimiran | PMunch: because Araq has some feelings for it and doesn't want to see it gone |
12:42:34 | FromGitter | <zetashift> @narimiran it sortof has a `yield` thing: https://ocaml.janestreet.com/ocaml-core/111.28.00/doc/core_kernel/#Sequence |
12:42:34 | FromDiscord | <Rika> hey! i read documentation! i was just lazy this one time! |
12:42:35 | PMunch | https://play.nim-lang.org/#ix=1Q0G |
12:42:40 | narimiran | but if you realized the existence of it just now, i'd say we're ok |
12:43:13 | PMunch | I might have a bug somewhere because of it though.. |
12:43:31 | narimiran | PMunch: did you use `add`? if not, you're fine. if you did: why did you? :D |
12:43:33 | FromDiscord | <has1> who is Araq |
12:43:38 | FromDiscord | <Rika> nim creater |
12:43:40 | FromDiscord | <Rika> creator. |
12:43:45 | narimiran | capo di tutti capi |
12:43:51 | FromDiscord | <Rika> "the nimmeister" mentioned somewhere above |
12:43:56 | FromDiscord | <Kiloneie> The man in the sky |
12:44:16 | PMunch | I might've done in a macro. It's generally easier to generate a call than a BracketExpr |
12:44:19 | FromDiscord | <has1> but why would he want a table (map) to have duplicate keys? |
12:44:22 | FromDiscord | <juan_carlos> For a really scary effect put the keys to empty string. |
12:44:23 | FromDiscord | <has1> that is what an array is for |
12:44:31 | PMunch | Wait, that behaviour is probably just because it's looking through the bucket sequentially. What happens if the table resizes :S |
12:44:51 | FromDiscord | <has1> no wait, actually arrays have duplicate values, not duplicate keys |
12:45:00 | PMunch | juan_carlos, wait why is that worse? |
12:45:16 | clyybber | Well a hashtable has linked list for collisions, this just appends to them right? |
12:45:39 | narimiran | zetashift: thanks, but currently i prefer to use "default ocaml", without jane street additions and modifications. i'm writing just some toy examples, so i prefer to keep it clean and lean, without all the additional syntax one should use with jane street stuff |
12:45:42 | FromDiscord | <juan_carlos> I didnt say worse :P |
12:46:14 | FromDiscord | <has1> but why does it have to be the set method though? |
12:46:27 | FromDiscord | <has1> couldn't it at least be some method like setDuplicate |
12:46:29 | FromDiscord | <has1> or something |
12:47:14 | FromDiscord | <has1> this api is just going to bite so many noobies from other languages |
12:47:29 | FromDiscord | <Rika> didnt bite me, i read the docs! |
12:47:32 | FromDiscord | <Rika> i swear! |
12:47:37 | narimiran | Zevv: look at what you have done!!! |
12:47:55 | FromDiscord | <has1> no one reads the docs of every function call they make.. |
12:48:10 | FromDiscord | <Rika> uh |
12:48:20 | FromDiscord | <Rika> hi i seem to be an exception |
12:48:33 | narimiran | and "nobody" writes `myTable.add(key, value)` |
12:49:09 | narimiran | do you write `[]=(mySeq, index, value)`? |
12:49:30 | FromDiscord | <has1> @narimiran why wouldn't you? |
12:49:41 | narimiran | because i'm a sane person |
12:50:00 | PMunch | Yup, it's not really deterministic: https://play.nim-lang.org/#ix=1Q0U |
12:50:13 | PMunch | Or I guess it's deterministic, but it appears arbitrary |
12:50:22 | FromDiscord | <has1> most java devs would call the method too btw |
12:50:39 | FromDiscord | <has1> @narimiran so much to a constructive argument.. |
12:50:48 | FromDiscord | <has1> @narimiran so much for a constructive argument.. |
12:51:05 | Zevv | narimiran: the fun I have! :) |
12:51:34 | Cadey | narimiran: to quote Q from star trek talking to Twilight Sparkle, "Making sense? Oh, dear Twilight, what fun is there in making sense?" |
12:51:38 | PMunch | has1, I think he meant calling it like that instead of calling it like `mySeq[index]=value` |
12:51:45 | FromDiscord | <has1> nim seems to be such a nice language, and then it does silly stuff like this. |
12:51:58 | Cadey | i actually like the syntax flexibility |
12:52:01 | Cadey | but i'm weird |
12:52:10 | PMunch | I like it as well :) |
12:52:11 | Zevv | narimiran: used to be a programmer, but these days I mainly get payed to walk in, talk to people and sow confusion. They call that "consultancy", and I'm perfectly fine with that. All I need to do is find the polka-dotted elephant, point at it and send my bills end of the month |
12:52:16 | narimiran | i'll repeat: i really don't like that we have `add`, i tried persuade Araq into removing it, but that didn't happen before v1.0, and it won't happen now, sorry |
12:52:26 | FromDiscord | <Kiloneie> i prefer more flexibility more freedom over THIS IS HOW YOU DO IT AND FUCK YOURSELF otherwise. |
12:52:35 | FromDiscord | <juan_carlos> Weirdo is the new Normie. |
12:53:04 | Zevv | narimiran: Maybe we should add a warning the the `add` proc, something like "This can introduce duplicate keys into the table!" in fat letters? |
12:53:12 | PMunch | narimiran, I don't mind `add`, but it should just throw an exception if the key already exists.. |
12:53:16 | narimiran | and now for the reason why it is here.... are you ready? |
12:53:23 | narimiran | https://en.wikipedia.org/wiki/Multimap |
12:53:24 | FromDiscord | <Kiloneie> that, that should be fixed |
12:53:29 | Cadey | PMunch: the real question is if `add` is PUT-like or POST-like |
12:53:31 | FromDiscord | <has1> @Kiloneie what do you mean? Do you mean you like duplicate keys in the map (table)? or are you saying you like that you can use m[key] = value or m.set(key, value) ? |
12:53:37 | narimiran | "map or associative array abstract data type in which more than one value may be associated with and returned for a given key" |
12:54:00 | Cadey | if add is PUT-like, then it would make sense to throw an exception |
12:54:11 | Cadey | if add is POST-like, then it makes sense for it to replace existing data |
12:54:13 | FromDiscord | <Kiloneie> i like different ways of doing anything, but if something makes a duplicate whilst other calls don't, it needs fixing |
12:54:22 | FromDiscord | <has1> @PMunch an exception is pretty bad too. It should just overwrite it |
12:54:23 | narimiran | PMunch: it is there so you can have the multimap behaviour |
12:54:43 | FromDiscord | <Rika> dont you think that should be separated into another object? |
12:54:49 | PMunch | Cadey, well it's called `add` which shouldn't update something that already exists |
12:54:53 | Zevv | (So, did we all decide on the color of the bikeshed, or should we assign a committee to agree on a voting procedure?) |
12:54:55 | Cadey | well |
12:54:58 | Cadey | does it actually? |
12:55:09 | narimiran | it doesn't matter what somebody thinks, jesus christ. it is part of nim v1.0. |
12:55:24 | Cadey | https://nim-lang.org/docs/tables.html#add%2CTable%5BA%2CB%5D%2CA%2CB |
12:55:26 | FromDiscord | <Rika> okay, im not trying to force anything |
12:55:30 | PMunch | Zevv, I think we should first decide where to place it |
12:55:40 | FromDiscord | <Rika> as long as it's documented i think it's fine |
12:55:42 | Cadey | this claims to put duplicate keys in the table? |
12:55:49 | Cadey | what does the hexdump of ram say? |
12:55:51 | FromDiscord | <has1> what do you guys think about adding a |
12:55:51 | FromDiscord | <has1> ".set" method there? That way it should be clearer for a user, so they look up the difference (and you can guess the difference) |
12:55:51 | narimiran | Cadey: yes, that's what we're discussing |
12:55:55 | PMunch | narimiran, I'm just trying to understand why :P |
12:56:12 | * | narimiran flips table |
12:56:16 | Zevv | hahaha |
12:56:17 | FromDiscord | <Rika> i mean it IS called add |
12:56:38 | narimiran | (and yes, pun was intended) |
12:56:47 | FromGitter | <zetashift> @narimiran yea I get that, but I was curious myself cause I used recursion for a lot of things instead of `yield`, but still I found myself quickly going through this: https://github.com/c-cube/ocaml-containers instead of using the stdlib. |
12:56:55 | FromDiscord | <Rika> i have no idea how to fix this... https://play.nim-lang.org/#ix=1Q2O |
12:57:04 | * | PMunch flips map |
12:57:29 | * | PMunch discovers riddle to find X on map that marks treasure |
12:57:30 | Cadey | Rika: s/{}/@[]/g |
12:57:41 | Cadey | oh wait |
12:57:44 | * | PMunch grabs a shovel and run for the hills |
12:57:45 | Cadey | that's a seq not a set |
12:57:46 | FromDiscord | <Rika> that looks like regex |
12:57:47 | FromDiscord | <juan_carlos> PUT-like?, Wait Table has a REST API? :P |
12:57:51 | PMunch | Uhm sorry, where were we? |
12:58:04 | Cadey | juan_carlos: it PUTs all of the table problems to REST |
12:59:41 | PMunch | Rika: https://play.nim-lang.org/#ix=1Q4r |
13:00:12 | FromDiscord | <Rika> is there a reason nim cannot compile it as is? |
13:00:30 | PMunch | Essentially the array just needs to know that the set is indeed a set[Style] (once the first element is known it will automatically know the others) |
13:00:55 | narimiran | right-hand side of `=` is not inferred from left-hand side |
13:00:55 | PMunch | Well, the reason is that the right hand side is evaluated before it's assigned to the left hand side |
13:01:02 | PMunch | Yeah |
13:01:12 | FromDiscord | <Rika> thanks |
13:01:29 | PMunch | I've asked about this before, not sure if I even got a clear answer as to why it can't do it |
13:01:30 | FromDiscord | <SrMordred> reading the conversations now about tables and add. |
13:01:30 | FromDiscord | <SrMordred> being able to duplicate values on the table means for me that this is not the best implementation of table that i could be using. |
13:01:37 | PMunch | Might just be difficult.. |
13:01:46 | FromDiscord | <Rika> oh no we're back to the table discussion |
13:01:49 | narimiran | i thought we moved on from that pile of shit |
13:01:51 | FromDiscord | <SrMordred> sorry xD |
13:01:55 | FromDiscord | <Rika> let's not |
13:02:17 | clyybber | It makes sense. It is called add, so its gonna add. |
13:02:30 | * | Zevv grins |
13:02:32 | clyybber | If it were called set I'd agree. But it isn't |
13:02:34 | PMunch | `import tables except add` problem solved |
13:02:46 | narimiran | SrMordred i would be glad if we had "the best implementation" of hashtables in some nimble package. i'm not being ironic |
13:03:05 | FromDiscord | <SrMordred> it´s just that this also caught me on surprise |
13:03:34 | narimiran | somebody could take that as their hacktoberfest task.... https://forum.nim-lang.org/t/5263 |
13:04:37 | * | go|dfish quit (Ping timeout: 240 seconds) |
13:04:42 | FromDiscord | <SrMordred> @narimiran i´m far from a hash table specialist, but i can try something for fun 😛 |
13:04:50 | narimiran | btw, there's this: https://github.com/LemonBoy/compactdict but "Same API as stdlib's Table" means there's `add` too |
13:06:22 | narimiran | zetashift thanks for the link for ocaml-containers |
13:07:29 | PMunch | narimiran, why is that repo archived? |
13:07:47 | clyybber | It's unmaintained and you should probably use my fork: https://github.com/Clyybber/compactdict |
13:08:01 | clyybber | Since my fork will replace LemonBoy's repo in important_packages |
13:08:11 | narimiran | PMunch: because lemonboy got upset, stopped working with nim, and is now using zig |
13:08:22 | Zevv | oh is he? |
13:08:24 | PMunch | Oh, that's unfortunate.. |
13:08:43 | PMunch | https://github.com/LemonBoy/compactdict/blob/master/src/compactdict.nim#L161-L162 <- By the way, it seems like it doesn't have the stdlib `add` |
13:08:45 | Zevv | was it a personal thing? |
13:08:58 | narimiran | clyybber: oh, nice! ping me when it is ready, and also modify nimble's packages.json to poing to your version |
13:09:26 | * | skoude quit (Ping timeout: 252 seconds) |
13:09:41 | narimiran | Zevv: yeah, he couldn't stand Table.add, and he left! :P |
13:09:51 | FromDiscord | <SrMordred> lol |
13:09:51 | narimiran | PMunch: ah, true |
13:09:57 | clyybber | narimiran: I'm doing that in the csize -> uint PR. I'm still waiting for nimgame to merge my PR and then I'll push my changes to minize CI usage |
13:10:03 | Zevv | Yeah, some leave beacuse of the tables, some leave because of the terrible music taste |
13:10:35 | clyybber | Wow, it just occured to me that leaves are called leaves because they leave the tree |
13:10:37 | clyybber | duh |
13:10:51 | FromDiscord | <turbosoggy> How disable gc |
13:11:06 | Zevv | turbosoggy --gc:none |
13:11:07 | clyybber | --gc:none |
13:11:19 | clyybber | Or if you don't want leaks: --newruntime |
13:11:23 | * | rockcavera joined #nim |
13:11:35 | FromDiscord | <turbosoggy> Will this prevent me from doing gc allocs |
13:11:36 | planetis[m] | does anyone know if hasCustomPragma is broken with typed macros? |
13:12:05 | Zevv | With --newruntime you can at least use *some* of the stdlib |
13:15:16 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:15:36 | FromDiscord | <exelotl> --gc:none is good for embedded, but you can't use strings, seqs, tables etc. |
13:16:28 | planetis[m] | am i doing something wrong: https://play.nim-lang.org/#ix=1Qi7 |
13:16:46 | clyybber | Zevv: With --gc:none you can use all of the stdlib :P |
13:17:06 | clyybber | FromDiscord: Can you not? |
13:17:13 | clyybber | I thought you could and it would just leak |
13:17:21 | clyybber | Nevermind then :) |
13:17:42 | * | clyybber quit (Quit: WeeChat 2.6) |
13:19:04 | PMunch | Well yes, you can still use it |
13:19:07 | PMunch | But it will leak |
13:19:15 | PMunch | Because there is no-one around to pick up garbage.. |
13:19:47 | FromDiscord | <exelotl> I've seen warnings about allocation occurring a couple of times, so it seems like Nim at least knows when they happen |
13:19:52 | Zevv | hm true, so you're better off then with --newruntime, because then you still can't use async or json :) |
13:21:12 | FromDiscord | <exelotl> In my case I only want static allocation so gc:none is perfect for me, but yeah I guess newruntime is usually the better choice for most people |
13:22:35 | PMunch | planetis[m], yeah that won't work |
13:29:24 | * | asymptotically joined #nim |
13:33:27 | PMunch | planetis[m], you can just "borrow" the logic of hasCustomPragma: https://play.nim-lang.org/#ix=1Qix |
13:35:50 | * | PrimHelios joined #nim |
13:37:21 | PMunch | planetis[m], or more easily with: https://play.nim-lang.org/#ix=1Qkr |
13:37:48 | PMunch | Essentially what you were checking was if the NimNode that held the `Ab` sym had a custom pragma, which it doesn't. |
13:38:52 | PMunch | This will create the call `hasCustomPragma(Ab, pin)` and then tell Nim to get the AST that would be returned by that call, which is a nnkSym that is either "true" or "false" |
13:44:09 | * | a_b_m joined #nim |
13:45:39 | * | PrimHelios quit (Quit: Leaving) |
13:46:25 | FromGitter | <rdlsf-omg> @PMunch An example of flutter: ⏎ https://flutter.dev/docs/development/ui/widgets-intro ⏎ ⏎ ```https://flutter.dev``` [https://gitter.im/nim-lang/Nim?at=5d94aa317fe6a605d16ba798] |
13:47:22 | planetis[m] | thank you PMunch! |
13:47:37 | * | abm quit (Ping timeout: 240 seconds) |
13:48:46 | planetis[m] | I think hasCustomPragma should have been a proc operating with NimNodes not a macro |
13:51:06 | * | shomodj joined #nim |
13:51:35 | narimiran | zetashift: i gave `containers` a quick try, and it seems like a great addition to my workflow, just what i needed! thank you! |
13:53:33 | PMunch | planetis[m], yeah the way it works now is a bit weird... It should at least offer both |
13:54:06 | * | PrimHelios joined #nim |
13:55:01 | PMunch | rdlsf-omg, hmm that looks interesting. Not entirely sure what sets it apart from a regular GUI toolkit with widgets though in your opinion |
13:55:23 | shashlick | @narimiran - any suggestions on https://irclogs.nim-lang.org/01-10-2019.html#23:29:46 |
13:56:19 | narimiran | shashlick: no idea, i'm on linux. sorry |
13:56:31 | PMunch | I mean you can use nimx on mobile, it uses SDL as it's back-end https://github.com/yglukhov/nimx |
13:57:02 | PMunch | It doesn't have it's own DSL ATM, but you should be able to create one fairly easily if it's consistent in how it works |
13:57:33 | shashlick | anyone on osx able to debug why return value is -1 for gorgeEx after a few tries |
13:57:53 | shashlick | broken since 0.19.6 at the very least |
13:58:23 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:58:50 | PMunch | Ah, apparently it has a layout DSL: https://github.com/yglukhov/nimx/blob/master/doc/layout-dsl.md |
13:59:17 | * | shomodj joined #nim |
14:00:24 | * | shomodj quit (Client Quit) |
14:01:15 | FromGitter | <zetashift> @narimiran thank the dudes who maintains the project, but glad you enjoy it! |
14:05:53 | livcd | I need a guide how to use simd for md5 hashing in Nim :X |
14:06:00 | livcd | Anyone here worked on something like that ? |
14:09:19 | narimiran | livcd: my wild guess would be @mratsim |
14:12:03 | shashlick | https://github.com/nim-lang/Nim/issues/12337 |
14:12:28 | shashlick | how do you debug an OSError / IOError condition to see what raises it |
14:13:22 | * | PMunch quit (Remote host closed the connection) |
14:14:03 | FromDiscord | <kodkuce> it sux when you dont know math, how do they expect me to do raindrops exercise |
14:15:43 | * | PrimHelios quit (Ping timeout: 250 seconds) |
14:19:23 | FromDiscord | <Kiloneie> google math |
14:20:36 | FromDiscord | <Rika> odd... using terminal, if you set bg as bgDefault setting fg doesnt seem to work |
14:21:26 | FromDiscord | <Kiloneie> theres a few things that didnt work for me either in terminal module |
14:22:05 | FromDiscord | <Rika> it's outdated-ish? it's a hard to test module i guess |
14:22:14 | FromDiscord | <juan_carlos> module has a reset too |
14:22:23 | FromDiscord | <juan_carlos> It seems to work to reset |
14:30:10 | shashlick | my issue is due to too many open files - seems like VM is not closing files or something |
14:30:19 | * | ripspin joined #nim |
14:32:20 | * | traviss quit (Read error: Connection reset by peer) |
14:33:53 | * | nsf quit (Quit: WeeChat 2.5) |
14:37:34 | * | theelous3 joined #nim |
14:38:59 | Zevv | shashlick: link? |
14:39:08 | Zevv | oh up there ^ |
14:41:30 | Zevv | indeed, gorge opens a pipe but does not close |
14:49:07 | Zevv | p.close() missing in gorgeimpl.nim? |
14:49:16 | disruptek | i tol' you george is a curious monkey. |
14:53:26 | Zevv | the name alone is abhorrent |
14:53:59 | disruptek | don't be rude. |
14:54:05 | disruptek | i have two kids named `alone`. |
14:56:28 | Zevv | shashlick: https://github.com/nim-lang/Nim/pull/12339 |
14:57:00 | * | go|dfish joined #nim |
14:57:25 | * | Trustable joined #nim |
14:58:29 | * | a_b_m quit (Quit: Leaving) |
14:58:53 | FromGitter | <rdlsf-omg> @PMunch thx, nice for nimx |
14:59:15 | FromGitter | <rdlsf-omg> i'll see if i can expand and replicate some of the flutter features |
15:02:09 | Araq | Zevv: I lost your Z3 gist |
15:02:18 | Araq | can you send it again please? |
15:02:41 | Araq | want to play with it a bit |
15:08:24 | Zevv | gist? its a nimble |
15:08:52 | Zevv | https://github.com/zevv/nimz3 |
15:09:31 | FromGitter | <alehander42> we have a monkey and a cat with a hat now |
15:09:47 | Zevv | who's the monkey? |
15:10:16 | FromGitter | <alehander42> that's just not respectful |
15:10:18 | FromGitter | <alehander42> to george |
15:10:31 | Zevv | george leaks |
15:10:41 | disruptek | you've been known to leak, yourself. |
15:10:45 | disruptek | don't deny it. |
15:10:54 | FromGitter | <alehander42> we all leak from time to time |
15:11:02 | Zevv | if you cant even clean up after yourself, there is no place for you in the stdlib |
15:11:23 | disruptek | he is but one of many such youngsters in the stdlib. |
15:11:26 | FromGitter | <alehander42> ok, doctor memory |
15:11:42 | Zevv | but to be honest, why do we not have proper language constructs to do this for us? |
15:11:56 | FromGitter | <alehander42> i just want to write |
15:11:58 | FromGitter | <alehander42> {.dontLeak.} |
15:12:05 | FromGitter | <alehander42> on the top of my file and be done with it man |
15:12:11 | disruptek | like what? context managers? |
15:12:29 | FromGitter | <alehander42> we have proper language destructs tho |
15:12:29 | Zevv | I want execProcess to just close when its going away. Easy RAII with a friendly syntax |
15:12:47 | Zevv | finally? |
15:12:53 | disruptek | yes. |
15:13:04 | * | daddoo quit (Quit: Leaving) |
15:13:12 | disruptek | when it works. 😉 |
15:13:13 | FromGitter | <alehander42> actually, isnt exactly that what destructors are supposed to do |
15:13:21 | Zevv | it is. but GC time is too late |
15:13:23 | FromGitter | <alehander42> i was making puns |
15:13:30 | Zevv | I know :) |
15:13:31 | FromGitter | <alehander42> didnt intend to make a valid argument |
15:13:34 | FromGitter | <alehander42> sorry |
15:14:21 | Zevv | Or is it that I just dont know how to do this? |
15:14:35 | FromGitter | <alehander42> so you want destructors tied to the scope? |
15:14:42 | Zevv | to lifetime |
15:14:52 | disruptek | c'mon; you can't use destructors because that isn't the semantic we're after. |
15:15:01 | Zevv | right |
15:15:15 | disruptek | finally or defer. |
15:15:19 | FromGitter | <alehander42> but lifetime is often tied to scope |
15:15:29 | FromGitter | <alehander42> i think finally and defer are not good |
15:15:30 | disruptek | i decide what's tied to what; i'm the programmer. |
15:15:35 | FromGitter | <alehander42> because you have to think of them |
15:15:41 | disruptek | yes. |
15:15:46 | disruptek | it's a mad mad mad mad mad world. |
15:15:52 | FromGitter | <alehander42> thinking man, you dont want to do that |
15:15:53 | FromGitter | <alehander42> too much |
15:15:54 | Zevv | yeah but what if the opened thingy goes living somewhere else for some time |
15:16:04 | disruptek | that's why i need to be in charge. |
15:16:18 | Zevv | its of course related to all the new stuff, newruntime, destructors, finalizers |
15:16:32 | FromGitter | <alehander42> well, you cant just move everywhere |
15:16:34 | disruptek | i really don't think so. |
15:16:40 | FromGitter | <alehander42> we need stricter emmigration laws |
15:16:46 | Zevv | but i got this guy at my desk going "weeelll, i have my shared_ptr, what do you have" |
15:16:55 | Zevv | and I go "uuuhhh" |
15:17:20 | FromGitter | <alehander42> that's not a bad name for a pointer as well |
15:20:06 | * | floppydh quit (Quit: WeeChat 2.6) |
15:23:07 | FromGitter | <awr1> hello |
15:25:33 | FromGitter | <awr1> @livcd i don't know of any SIMD approach to MD5 (but i would be hardly surprised if it exists) |
15:25:50 | FromGitter | <awr1> i do know that newer x86 CPUs has instructions for computing SHA |
15:25:53 | FromGitter | <awr1> SHA-1 |
15:26:00 | FromGitter | <awr1> 1) SHA-256 |
15:26:06 | FromGitter | <awr1> https://en.wikipedia.org/wiki/Intel_SHA_extensions |
15:28:24 | * | Vladar joined #nim |
15:34:04 | * | shomodj joined #nim |
15:41:47 | * | zyklon quit (Quit: Konversation terminated!) |
15:42:00 | * | zyklon joined #nim |
15:45:50 | FromDiscord | <mratsim> It's not newer CPU, it's Atom Goldmont and future Cannon-lake only |
15:46:03 | FromDiscord | <mratsim> I have the latest intel CPU and no SHA :/ |
15:46:56 | FromDiscord | <Kiloneie> isn't Atom discontinued because ARM cpus wreck it because of power usage ? |
15:52:59 | * | sealmove joined #nim |
15:54:00 | Araq | Zevv: we got destructors and moves, just like C++ does, a shared_ptr is about 50 lines of code |
15:54:12 | Araq | except that the stdlib doesn't offer it yet |
15:55:52 | * | owl_000 quit (Ping timeout: 245 seconds) |
15:56:22 | FromDiscord | <has1> hi, how do I do this with nim? |
15:56:23 | FromDiscord | <has1> https://play.nim-lang.org/#ix=1R4x |
15:57:22 | FromDiscord | <has1> i want the method "add" to only allow a key of type K and a value of type V which were previously used in the table declaration |
16:03:44 | FromDiscord | <Rika> how do i make an "only keyword argument" proc (like python's (arg, *, keyword_only) |
16:06:47 | lqdev[m] | @has1 your proc is missing the [K, V] generic parameters |
16:08:04 | lqdev[m] | https://play.nim-lang.org/#ix=1R63 |
16:08:11 | lqdev[m] | though, I'm not sure why this errors |
16:08:14 | * | solitudesf joined #nim |
16:15:09 | FromDiscord | <Rika> @has1 https://play.nim-lang.org/#ix=1R9F |
16:16:00 | FromDiscord | <Rika> had to kinda simplify it (removed speak because me dumb, it being there hurt my brain juice) |
16:19:43 | * | hades joined #nim |
16:20:05 | * | hades is now known as Guest36309 |
16:20:29 | * | Guest36309 is now known as fichtl |
16:21:29 | * | krux02 joined #nim |
16:24:15 | sealmove | Hey guys, in streams module there is FileStream and StringStream. If I need to make a stream out of a seq (which is saved in a variable), I have to implement it? Or is there a common way to do this? |
16:24:58 | disruptek | what's in the seq? |
16:25:17 | * | LargeEpsilon quit (Ping timeout: 240 seconds) |
16:25:23 | sealmove | just data |
16:25:33 | sealmove | ah I mean, it's a seq[byte], sorry |
16:26:01 | disruptek | join it into a string. i thought you had something arbitrary, in which case you want, like, channels or something. |
16:27:31 | sealmove | so seq[byte] -> string -> StringStream? |
16:27:39 | disruptek | sure. |
16:27:45 | sealmove | great, thzx |
16:31:49 | * | nsf joined #nim |
16:38:07 | FromDiscord | <has1> @Rika so i need this init function there? |
16:38:52 | FromDiscord | <mratsim> @sealmove there is a ByteStream normally |
16:39:04 | sealmove | where? |
16:39:12 | FromDiscord | <Rika> no afaik, you can just copy paste the thing there (that would mean writing `Person[string, string](data: newTable[string, string]())` though which is looooooong af) |
16:40:31 | FromDiscord | <Rika> hey, im prolly just as noob as you, but i think that's right. maybe verify with someone else if you dont trust me xd |
16:40:41 | FromDiscord | <mratsim> oh, seems like it wasn't merged: https://github.com/nim-lang/Nim/pull/7481 |
16:41:27 | FromDiscord | <has1> @Rika so i can access the data variable inside the object and use its api correctly |
16:41:32 | FromDiscord | <mratsim> you can use cast[string](yourSeqByte) or use faststreams: https://github.com/status-im/nim-faststreams |
16:41:36 | FromDiscord | <has1> but i cant wrap it in a method?? |
16:41:45 | FromDiscord | <Rika> what? |
16:42:11 | FromDiscord | <Rika> sorry, i dont understand what you mean |
16:42:23 | FromDiscord | <Rika> the add method works if you look again |
16:43:39 | sealmove | mratsim: is cast[string](yourSeqByte) better than join(yourSeqByte)? |
16:44:08 | Zevv | Is it possible for a string to still be nillable? I have a callback function that I'd like to return a string, but I need to see the difference between no result/return or en empty result/return |
16:44:24 | FromDiscord | <Rika> is there a library for vector math in nim? |
16:44:40 | FromDiscord | <Rika> roughly analogous to python's numpy? |
16:45:19 | Zevv | yes there is indeed |
16:45:47 | Zevv | Arraymancer: https://github.com/mratsim/Arraymancer |
16:45:54 | FromDiscord | <has1> @Rika no it doesnt work |
16:45:55 | FromDiscord | <has1> https://play.nim-lang.org/#ix=1Rlo |
16:46:06 | FromDiscord | <has1> you are using a TableRef instead of a Table too |
16:46:16 | FromDiscord | <Rika> must it use a Table? |
16:46:24 | FromDiscord | <Rika> you're not echoing the data again after the add |
16:46:37 | sealmove | Zevv: Option[string]? |
16:47:04 | Zevv | hm but then the callback needs to return some(""), right? |
16:47:08 | FromDiscord | <has1> @Rika i am echoing the object |
16:47:16 | FromDiscord | <has1> and tableref seems to be a bad idea |
16:47:18 | FromDiscord | <Rika> before the add function |
16:47:18 | FromDiscord | <has1> "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" |
16:47:25 | FromDiscord | <Rika> what did you do? |
16:47:26 | sealmove | Zevv: yes |
16:47:32 | Zevv | bah :( |
16:47:43 | FromDiscord | <has1> The code is above |
16:47:47 | FromDiscord | <Rika> you didnt "initialize" the table |
16:47:57 | Zevv | I'll provide a closure proc instead that the callback can call... |
16:48:05 | FromDiscord | <has1> @Rika Yes, that is the point |
16:48:32 | FromDiscord | <has1> is there no way to make the add method work? |
16:48:36 | FromDiscord | <Rika> let me see if i can use table |
16:48:43 | FromDiscord | <Rika> using table, set has to be variable |
16:49:55 | FromDiscord | <has1> i mean look at this |
16:49:56 | FromDiscord | <has1> t.data["test"] = "new" |
16:50:09 | FromDiscord | <has1> i can directly access the data (which is a table) |
16:50:18 | FromDiscord | <has1> all i want to do now is wrap this in a method |
16:51:42 | FromDiscord | <Rika> dumbass i am |
16:51:45 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=1Rm6 |
16:51:48 | FromDiscord | <has1> This is more of a generics question in general for me, not a table question |
16:51:56 | FromDiscord | <Rika> oops |
16:51:59 | FromDiscord | <Rika> wrong link |
16:52:00 | FromDiscord | <Rika> lmao |
16:52:23 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=1Rm9 @has1 this seems to work |
16:53:30 | FromDiscord | <has1> yes i just tried that after seeing the var thing, this is exactly what i was looking for it seems, thanks! |
16:53:39 | * | lritter joined #nim |
16:54:45 | Zevv | so to make sure: there is no way to make a string still nillable? |
16:55:00 | * | LargeEpsilon joined #nim |
16:55:07 | Zevv | with some pragma magic or whatever |
16:56:19 | disruptek | i would love it if the PRs to the nimble package repo included the description and tags in the generated comments so we can keep track of new software in email or github notifications. |
16:56:41 | disruptek | Zevv: use a `ref string`. |
16:56:50 | disruptek | or a cstring. |
16:57:44 | disruptek | having the url to the package homepage would be pretty handy, too. |
16:57:53 | Zevv | ah cstring, good trick, thanks! |
17:00:50 | * | nif quit (Quit: ...) |
17:01:01 | * | nif joined #nim |
17:10:16 | disruptek | alehander42 are you still the resident expert on osproc? |
17:11:22 | sealmove | though you should probably try to work with Nim strings. there is a reason they can't be nillable |
17:11:40 | Cadey | sealmove: do a ref string |
17:11:53 | Cadey | or Option[string] |
17:12:01 | Cadey | Option[string] is probably better |
17:14:05 | FromGitter | <kdheepak> Hi all, if I have a `let value = "1 2 3 4 5 6`, and want to return `@[1, 2, 3, 4, 5, 6]`, what would be the nim idiomatic way to do this? `value.split()` returns `""` elements in the sequence. |
17:15:41 | FromGitter | <kdheepak> In Python the split does what I expect. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d94db3deb1eff63d664c1f0] |
17:16:17 | FromDiscord | <Generic> the thing is that Nim is statically typed |
17:16:42 | FromDiscord | <Generic> in python there's not really a difference (I don't know it that well) between a text string |
17:16:46 | FromDiscord | <Generic> containing a number |
17:16:50 | FromDiscord | <Generic> and number itself |
17:17:17 | FromDiscord | <Generic> or atleast the conversion is often done implicitly |
17:17:20 | FromGitter | <kdheepak> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d94dba0086a72719ea1d4e6] |
17:19:56 | shashlick | @Zevv thanks for that PR! |
17:20:11 | shashlick | Now to figure out how to support all the older releases of Nim |
17:20:12 | FromDiscord | <Generic> https://gist.github.com/RSDuck/f2d4d6c0fee371314cbd3de2e957e77c |
17:20:23 | FromDiscord | <Generic> @kdheepak |
17:20:43 | FromDiscord | <Generic> that's how it's done in Nim, though of course it depends on what you're trying to archive |
17:20:54 | * | Trustable quit (Remote host closed the connection) |
17:21:11 | FromDiscord | <Generic> in this example we're parsing ints, but we would have to use parseFloat for floats |
17:21:25 | FromGitter | <kdheepak> Ah |
17:21:39 | FromDiscord | <Generic> it also fails if one of the objects is not something parseInt can parse |
17:21:46 | FromGitter | <kdheepak> What is value contains abitrary strings |
17:22:01 | * | birdspider quit (Remote host closed the connection) |
17:22:04 | FromDiscord | <Generic> parseInt throws a ValueError |
17:22:14 | FromGitter | <kdheepak> ```value = " as=sfa ssee ess 1 2.0-1 s"``` |
17:22:44 | * | drewr quit (Quit: ERC (IRC client for Emacs 26.3)) |
17:22:51 | FromGitter | <kdheepak> Also, what is `it` in your gist. |
17:22:56 | FromDiscord | <Generic> https://play.nim-lang.org/#ix=1RGp |
17:23:43 | FromDiscord | <Generic> mapIt is a template, defined in sequtils |
17:24:18 | FromDiscord | <Generic> it basically generates this code |
17:24:36 | FromDiscord | <Generic> for it in mitems(yourseq): |
17:24:54 | FromDiscord | <Generic> then it inserts the code passed to mapIt |
17:25:18 | FromDiscord | <Generic> and makes sure that it from the for loop is accesible for the inserted code |
17:27:13 | FromDiscord | <Generic> https://nim-lang.org/docs/sequtils.html#mapIt.t%2Ctyped%2Cuntyped |
17:28:44 | * | drewr joined #nim |
17:30:05 | FromDiscord | <Generic> this is for example how you can only take those items which are parseable numbers https://play.nim-lang.org/#ix=1RGC |
17:33:04 | * | LargeEpsilon quit (Ping timeout: 264 seconds) |
17:36:08 | yumaikas | Is there a reason I shouldn't use the standard library tables? Or just API concerns? |
17:42:59 | * | dddddd joined #nim |
17:45:03 | * | Vladar quit (Remote host closed the connection) |
17:45:17 | FromDiscord | <kodkuce> raindrops finished, factorials are easy if you know what they are, anyway i switched to practice mode cuz mentors lazy so now i lost track what should i do next, and for some retarded reason cant switch back, anyone have screenshot of exercism track |
17:45:22 | FromGitter | <xmonader> is there a reliable connection pool library? |
17:45:51 | shashlick | @dom96 - PRs when you get a chance? |
17:46:08 | FromGitter | <xmonader> I'd like to extend some libraries with a connection pool and it's not really the easiest thing to get `correctly` |
17:51:19 | FromDiscord | <Kiloneie> main exercises on exercism are not maintained anymore, even after a week my program wasn't checked. Do the side ones and check them again the unitest file provided. |
17:51:38 | * | daddoo joined #nim |
17:56:56 | shashlick | does `ulimit -n 1024` work on osx? |
17:57:12 | Cadey | let's find out |
17:57:25 | Cadey | yes |
17:57:31 | Cadey | default is 4864 |
17:57:41 | shashlick | really? |
17:57:44 | shashlick | newer osx? |
17:57:49 | Cadey | 10.14 |
17:58:15 | shashlick | wonder what it is on travis |
17:58:34 | FromDiscord | <kodkuce> i just wanted to fallow diagram, i switched to practice mode so all unclocked, how to cast int to string i tryed $ didnet work or i retarded |
17:58:35 | shashlick | travis is 10.13 |
17:59:13 | * | NimBot joined #nim |
18:00:02 | lqdev[m] | @kodkuce what error? |
18:02:34 | FromDiscord | <kodkuce> for n in 0..$input.len(): << meybe cuz am trying to do it like this |
18:03:38 | FromDiscord | <kodkuce> am tyring to do for each char in number |
18:03:56 | FromDiscord | <kodkuce> 256 - for 2, for 5, for 6 |
18:04:40 | lqdev[m] | `for c in $input` |
18:04:47 | lqdev[m] | it's that simple |
18:05:27 | lqdev[m] | also, operators other than `@` apply to the whole expression, so `$input.len` is `$(input.len)` not `($input).len` |
18:05:28 | FromDiscord | <kodkuce> for n in 0..input.intToStr.len(): << hmm i solve it like this |
18:05:53 | FromDiscord | <kodkuce> for c in $input should give me chars and i wnat ints |
18:06:05 | lqdev[m] | aah, I get what you mean |
18:06:34 | lqdev[m] | you can create a variable `digit` inside the loop's body with the value `parseInt(c)` |
18:07:09 | FromDiscord | <kodkuce> that can work too but this way i have no parses |
18:07:22 | FromDiscord | <kodkuce> multiple times at least 🙂 |
18:10:18 | lqdev[m] | I don't think what you're trying to achieve is possible, but I remember there was a simple formula for extracting a digit from a number |
18:10:21 | * | tklohna joined #nim |
18:10:24 | lqdev[m] | give me a sec |
18:13:03 | daddoo | if you know it's a digit, subtract 48 from the character's ASCII value if you're working in ASCII |
18:13:04 | * | tklohna quit (Read error: Connection reset by peer) |
18:13:20 | lqdev[m] | try this: `trunc(x mod 10 ^ n / 10 ^ (n - 1))` where `x` is your input number, where `n` is the decimal place. 1 is ones, 2 is tens, 3 is hundreds, etc. |
18:13:55 | FromDiscord | <kodkuce> lol worst thing is i just figure out i dont need this, i was solwing quest wrong |
18:14:45 | FromDiscord | <kodkuce> or not hmm need to think, birds have small brains i guess xD |
18:17:32 | FromDiscord | <Lunar> I just dual booted Linux Mint onto my Windows laptop. I got impatient for it to restart (everything was done), and unplugged the USB. In 20 minutes, the BIOS completely drained my 80% battery trying to recover the lost stuff |
18:17:45 | FromDiscord | <Lunar> Note to self, have patience |
18:17:46 | FromDiscord | <kodkuce> wtf |
18:17:55 | FromDiscord | <Lunar> Yea |
18:18:16 | FromDiscord | <kodkuce> solution = delete Windows it sux |
18:18:18 | FromDiscord | <Lunar> It was spewing stuff into console, 10 messages a second |
18:18:29 | FromDiscord | <Lunar> Lmao why do you think I dual booted Linux |
18:18:39 | * | asymptotically quit (Quit: Leaving) |
18:18:48 | FromDiscord | <Lunar> In reality, I'd like to have all three OS's on my laptop |
18:18:56 | FromDiscord | <kodkuce> why? |
18:18:56 | FromDiscord | <Lunar> So I can run whatever I need |
18:19:32 | FromDiscord | <kodkuce> hmm, only thing i miss on linux is legit Solidworks, there is 1 online Onshape or that SimensNX(expensive as f) |
18:20:00 | FromDiscord | <Lunar> I have no clue what any of that is. I program, not usually deal with hardware 😂 |
18:20:27 | FromDiscord | <Lunar> I have no clue what any of that is. I program, not usually deal with BIOS 😂 |
18:21:58 | FromDiscord | <kodkuce> Solidworks= Parametrict modeling, like for creating a tehnical 3d model |
18:22:20 | FromDiscord | <kodkuce> you program in c# thats why need Windows or what? |
18:23:46 | FromDiscord | <Kiloneie> What is the main difference between iteration of a containter/iterable withing a for loop, between iteration of every element by specifiy the container and using container.low .. container.high ? |
18:23:46 | FromDiscord | <Kiloneie> I know there are difference, and i have seem them, but i honestly forgot... |
18:23:47 | FromDiscord | <kodkuce> i spined a w10 in virtualbox for a job some stupit SQL app for windows , but i resigned after 2 days was uber boring work |
18:25:38 | FromDiscord | <kodkuce> hmm , i think for element in someseq it behaves like foreach in c# or some other lang, if you do for i in 0..seq.len() then you get index number too if you need it |
18:26:05 | FromDiscord | <Kiloneie> oh yeah, index is unavailable in the first one |
18:27:48 | FromDiscord | <kodkuce> whats operator for sqare num , example i want 3 on 3 = 3x3x3 = 27 |
18:28:18 | FromDiscord | <Kiloneie> maybe ^ |
18:28:24 | FromDiscord | <Kiloneie> or power idk |
18:28:54 | FromDiscord | <Kiloneie> that is usually how it's done in other languages, haven't done it in Nim yet. |
18:29:57 | FromDiscord | <kodkuce> https://nim-lang.org/docs/manual.html#lexical-analysis-operators , here they listed but i duno to read between the lines 🙂 |
18:31:20 | * | ripspin quit (Remote host closed the connection) |
18:31:39 | FromGitter | <alehander42> disruptek |
18:31:42 | FromGitter | <alehander42> am i an expert |
18:31:47 | FromGitter | <alehander42> i just ctrl+p osproc.nim |
18:31:49 | FromGitter | <alehander42> all the time |
18:31:51 | FromGitter | <alehander42> in my editor |
18:31:52 | FromGitter | <alehander42> :P |
18:32:51 | disruptek | what's ctrl+p? |
18:33:00 | FromGitter | <alehander42> jump to file |
18:33:03 | FromGitter | <alehander42> with fuzzy search |
18:33:20 | disruptek | well, i know you were trying to capture stdout and stderr, iirc. |
18:33:27 | FromGitter | <alehander42> oh yeah |
18:33:29 | FromDiscord | <Kiloneie> try math module |
18:33:31 | FromGitter | <zetashift> @Kiloneie try https://nim-lang.org/docs/math.html#pow%2Cfloat32%2Cfloat32 |
18:33:37 | FromGitter | <alehander42> iirc it needed a PR to add a difference |
18:33:43 | FromGitter | <alehander42> but i think @timotheecour |
18:33:47 | FromGitter | <alehander42> had a similar plan? |
18:33:49 | FromDiscord | <Kiloneie> lol i beat you to it |
18:33:58 | FromGitter | <zetashift> rip |
18:34:20 | FromDiscord | <Kiloneie> don't have time right now, was too lazy today, terrible weather and all. Ahh still haven't started recording, this video is gonna be long as fuck D: |
18:34:22 | disruptek | i dunno. i think i have to just use selectors on the handles so i don't block. |
18:34:38 | disruptek | don't wanna wait around for a fix or have to contest it in a pr. |
18:34:48 | FromDiscord | <kodkuce> in math there is sqrt but no square or square on |
18:35:54 | FromDiscord | <Kiloneie> pow() |
18:36:51 | FromDiscord | <kodkuce> ty |
18:39:17 | FromDiscord | <kodkuce> hmm do i really have to convert ints to floats to use pow, shoudent pow eat ints too? |
18:40:00 | FromDiscord | <Kiloneie> it should... |
18:40:02 | FromDiscord | <Kiloneie> idk |
18:41:09 | FromDiscord | <kodkuce> am just complaining to masters or whoewer wrote math 🙂 |
18:41:51 | FromDiscord | <kodkuce> lol i am blind it even says to compute betwin integers use ^proc |
18:43:14 | FromDiscord | <kodkuce> hmm |
18:45:08 | rayman22201 | ping @timotheecour. My friend, can you address some of my questions on github when you get the chance? thank you :-) https://github.com/nim-lang/Nim/issues/12330 |
18:45:26 | * | solitudesf- joined #nim |
18:46:19 | * | solitudesf- quit (Remote host closed the connection) |
18:46:43 | * | solitudesf- joined #nim |
18:47:47 | * | solitudesf quit (Ping timeout: 268 seconds) |
18:48:19 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:54:09 | * | shomodj joined #nim |
18:54:13 | * | shomodj quit (Read error: Connection reset by peer) |
19:03:39 | kevinsjoberg | I just bought Nim in Action since I want to explore the language a bit. Any recommended editor? I'm open for anything. |
19:04:08 | Araq | vscode |
19:06:04 | kevinsjoberg | Araq: Thanks, I'll try that out. |
19:16:35 | narimiran | kevinsjoberg: neovim + nim.nvim plugin |
19:21:45 | * | shomodj joined #nim |
19:25:28 | * | Ven`` joined #nim |
19:31:42 | FromDiscord | <Kiloneie> Visual Studio Code |
19:31:48 | FromDiscord | <Kiloneie> + nim extension |
19:32:08 | FromDiscord | <Kiloneie> you can watch my #1 intro video for how to set it all up if you need help |
19:32:30 | rayman22201 | @lqdev[m] I can't seem to get your game to run :-( |
19:32:53 | lqdev[m] | rayman22201: what's your issue? |
19:33:01 | rayman22201 | https://github.com/liquid600pgm/memrecall/issues/5 |
19:33:20 | lqdev[m] | oh, this. |
19:33:21 | rayman22201 | also: https://github.com/liquid600pgm/memrecall/issues/4 |
19:33:34 | lqdev[m] | what graphics drivers are you on? |
19:34:00 | shashlick | anyone done a nim project using wxwidgets |
19:34:06 | shashlick | without using the entire wxnim |
19:34:09 | * | Kaivo quit (Quit: WeeChat 2.6) |
19:34:16 | * | sealmove quit (Quit: WeeChat 2.6) |
19:34:38 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:35:05 | rayman22201 | lqdev[m] Quadro Desktop/Quadro Notebook Driver Release 435 |
19:36:09 | lqdev[m] | then this is very weird |
19:36:18 | lqdev[m] | maybe nvidia is doing their thing again |
19:36:40 | lqdev[m] | I'll update rapid to not require direct state access |
19:37:45 | lqdev[m] | rayman22201: I'll let you know when I'm done with that, hopefully it will work! |
19:38:22 | rayman22201 | cool :-) |
19:38:38 | rayman22201 | yay Nvidia close source driver nonsense :-P |
19:40:19 | lqdev[m] | this didn't happen to me while I was using nvidia drivers, can you tell me which OpenGL version does `glxinfo | grep OpenGL` (or some windows equivalent) report? |
19:40:20 | disruptek | !eval let 😉 = "wink"; echo 😉 |
19:40:23 | NimBot | wink |
19:43:12 | rayman22201 | lqdev[m] https://gist.github.com/rayman22201/e76535c6c8ca2950aa7aa0c81870f7aa |
19:43:42 | rayman22201 | oh, I just realized it's using the embedded intel drivers |
19:43:44 | rayman22201 | interesting |
19:44:45 | lqdev[m] | rayman22201: you can change which graphics driver an app uses in windows's settings |
19:45:13 | rayman22201 | yeah, looking to see if I can do that now |
19:45:54 | lqdev[m] | I'll have to fix it anyways since your graphics cards only support the older EXT variant, I need the ARB one since it has a different API |
19:47:33 | rayman22201 | well this is absurd. My laptop has an external monitor plugged in. Windows is telling me that it's using the Nvidia drivers for the external monitor, but the intel drivers for the attached monitor. |
19:48:19 | Cadey | when's nimcon? |
19:48:38 | rayman22201 | I suppose you should fix it anyway, because many lower end laptops only have the embedded Intel Graphics card these days. |
19:49:51 | lqdev[m] | I'm currently in the process of fixing it, give me like, 20 minutes or more |
19:50:04 | lqdev[m] | I need to port the entire codebase to use my internal GLContext thing |
19:50:15 | lqdev[m] | tbh there's not that much that used this extension though |
19:50:26 | lqdev[m] | only RCanvas used it for framebuffers |
19:52:54 | rayman22201 | sorry for my weird graphics configuration :-/ |
19:57:15 | lqdev[m] | it's not your fault |
19:57:42 | lqdev[m] | the driver developers failed, all we can do is adjust to their mistakes :/ |
19:58:20 | rayman22201 | indeed |
19:58:48 | rayman22201 | I'm still confused why Windows is falling back to the intel drivers for one monitor and not the other... but that's an entire other can of worms |
19:59:12 | disruptek | two different video cards. |
20:01:59 | FromGitter | <awr1> @rayman22201 some of the AMD laptops have vega solutions |
20:02:46 | shashlick | oh man finally - https://travis-ci.org/genotrance/nimarchive |
20:03:38 | rayman22201 | well duh, of course there are two video cards. I just don't understand why Windows is not letting the Nvidia card control both monitors. (My guess is something crashed and Windows silently went into a fallback mode.) |
20:04:38 | rayman22201 | I probably need to restart, but I have too many things open that I don't want to close atm :-P |
20:05:16 | lqdev[m] | rayman22201: try `nimble install rapid` and recompile the game |
20:05:20 | lqdev[m] | it should work now |
20:07:03 | rayman22201 | @shashlick does that mean we will have tar file support soon? yay :-) |
20:07:22 | rayman22201 | lqdev[m] trying now |
20:10:19 | shashlick | you already have tar file with untar |
20:10:23 | shashlick | and gz |
20:10:40 | shashlick | but now you will have pretty much anything supported by libarchive |
20:11:00 | shashlick | i might need to add more support but for now there's zlib, bzlib and lzma linked in |
20:11:11 | rayman22201 | yay |
20:11:25 | rayman22201 | lqdev[m] it works now 👍 🎉 |
20:11:36 | rayman22201 | and there goes my productivity for the day |
20:12:40 | shashlick | okay - any more concerns with getHeader as it stands today? else i'll be merging v020 into nimterop master |
20:13:14 | * | narimiran quit (Ping timeout: 240 seconds) |
20:13:20 | lqdev[m] | rayman22201: the game's not that long, even if you collect all the atoms :) |
20:13:22 | lqdev[m] | anyways, good luck! |
20:14:08 | rayman22201 | lol. I'm really bad at games. Thanks though :-) |
20:14:49 | shashlick | @lqdev - i added a way to set -d:xyz in code itself - needed it for nimarchive anyway |
20:15:02 | FromDiscord | <Kiloneie> Here we go again! |
20:15:03 | FromDiscord | <Kiloneie> LINK: https://youtu.be/YFSuu0degn0 |
20:15:36 | shashlick | @lqdev - https://github.com/genotrance/nimarchive/blob/nimterop/nimarchive/archive.nim#L24 |
20:16:06 | lqdev[m] | oh, this is really nice |
20:16:19 | lqdev[m] | I'm gonna try getHeader out when I'll be porting rapid to SDL |
20:16:56 | shashlick | okay looking forward to your feedback |
20:17:00 | FromDiscord | <Kiloneie> I tried your suggestion nmirian, which i think worked for part 1 of the video, but then i fucked up and spent way too much time reading, which resulted in a worse video and more time recording and editing... good suggestion though, not exactly what you had in mind, but it's gonna help me a lot with the next video. I should read as little as possible, only explanations and such that i can't do it freely, i get stuck when reading a LOT, make |
20:19:55 | shashlick | @PMunch - is there any reason why the wxnim wrapper doesn't support dlls? static link only? |
20:47:03 | * | nsf quit (Quit: WeeChat 2.5) |
21:00:58 | * | clyybber joined #nim |
21:29:23 | * | traviss joined #nim |
21:34:23 | * | daddoo quit (Quit: Leaving) |
21:37:08 | * | shomodj joined #nim |
21:40:54 | FromGitter | <zetashift> @lqdev why not just stick with GLFW? |
21:41:48 | lqdev[m] | @zetashift it's not about the video, it's about the audio |
21:41:52 | lqdev[m] | apparently I can't use libsoundio |
21:42:22 | lqdev[m] | so because I'm gonna use sdl_audio I thought why not use sdl_video anyways |
21:42:32 | * | solitudesf- quit (Ping timeout: 245 seconds) |
21:50:21 | FromGitter | <zetashift> ah |
21:54:19 | FromGitter | <davidbruce> In sdl2 how do you pass a ptr of a Rect to the copy proc ⏎ https://github.com/nim-lang/sdl2/blob/b5e38a2a2c0a12d63f4d432a8d67d74097580acb/src/sdl2.nim#L1001 ⏎ ⏎ I guess the better question is how do I make a ptr to a tuple? [https://gitter.im/nim-lang/Nim?at=5d951c8bfcb47b627f06d6b8] |
21:55:11 | FromGitter | <zetashift> addr(aRect)? |
21:55:15 | lqdev[m] | @davidbruce use `addr` |
21:55:41 | FromGitter | <davidbruce> thaaaaaaaaaaaaaaaaaaank you |
21:55:54 | lqdev[m] | or aRect.addr, whichever you prefer |
21:56:13 | FromGitter | <zetashift> ^ yes! |
21:56:25 | FromGitter | <davidbruce> Is this covered anywhere in the docs? |
21:57:21 | * | abm joined #nim |
21:57:21 | FromGitter | <zetashift> I'm not sure but I had a similiar problem like you following lazyfoo's tutorial and I think I got my answer from: https://github.com/Vladar4/sdl2_nim/tree/master/examples |
21:57:35 | FromGitter | <zetashift> or do you mean passing pointer arguments to proc's? |
21:58:05 | FromGitter | <davidbruce> Sorry, passing pointer arguments in procs |
21:58:17 | FromGitter | <davidbruce> The other link looks really useful too though, thanks! |
21:59:34 | FromGitter | <zetashift> we have this: https://nim-lang.org/docs/system.html#addr%2CT |
22:00:12 | FromGitter | <zetashift> and this: https://nim-lang.org/docs/manual.html#statements-and-expressions-the-addr-operator but in the 2 tutorials it isn't covered IIRC |
22:01:31 | FromGitter | <davidbruce> Thanks for the links again, you've been a big help! |
22:11:58 | FromDiscord | <exelotl> is there a way to pass environment variables to staticExec? |
22:14:25 | FromGitter | <zetashift> shouldn't those automatically be found when it executes the other process? |
22:27:05 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:36:04 | FromDiscord | <exelotl> yeah, I wanted to override one at compile time |
22:36:55 | FromDiscord | <exelotl> (trying to set up a nimterop script that invokes pkg-config, but with the PKG_CONFIG_PATH variable being set to some directory that's local to the project) |
22:43:22 | * | theelous3 quit (Ping timeout: 245 seconds) |
22:43:51 | shashlick | Just use getEnv |
22:44:06 | * | theelous3 joined #nim |
22:50:05 | * | theelous3 quit (Ping timeout: 276 seconds) |
22:50:25 | shashlick | putEnv rather |
22:51:38 | * | clyybber quit (Quit: WeeChat 2.6) |
22:58:54 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:12:21 | FromDiscord | <exelotl> oh cool static: putEnv does work |
23:15:11 | * | krux02_ joined #nim |
23:15:36 | FromDiscord | <juan_carlos> Stuff that works on NimScript usually works static, and is listed on the NimScript docs. |
23:17:48 | * | krux02 quit (Ping timeout: 245 seconds) |
23:28:28 | * | krux02_ quit (Remote host closed the connection) |
23:29:01 | * | theelous3 joined #nim |
23:29:15 | * | theelous3 quit (Read error: Connection reset by peer) |
23:30:06 | FromDiscord | <treeform> @Kiloneie good job. It's hard sticking with some thing once it's not a novelty any more. |
23:32:48 | disruptek | someone confirm this one for me: |
23:33:12 | disruptek | put -d:danger in your nim.cfg and build something normally. it will report a `Dangerous Release Build`. but, it's actually not one. |
23:37:13 | * | abm quit (Read error: Connection reset by peer) |