<< 21-01-2018 >>

00:35:27*endragor joined #nim
00:37:39*kier quit (Ping timeout: 268 seconds)
00:39:17*Cthalupa quit (Ping timeout: 276 seconds)
00:39:19*PMunch quit (Quit: leaving)
00:39:59*endragor quit (Ping timeout: 248 seconds)
00:40:06*Cthalupa joined #nim
00:43:03*Trustable joined #nim
00:48:37*kier joined #nim
00:50:09*Cthalupa quit (Ping timeout: 264 seconds)
00:51:52*Trustable quit (Remote host closed the connection)
00:53:21FromGitter<Varriount> @Quelklef Making a parser generator?
00:54:17*Cthalupa joined #nim
00:55:38FromGitter<Quelklef> Yessir :) although I didn't know that's what they're called when I started
01:27:49FromGitter<Quelklef> actually, if you know things about things, could you tell me what class parser im writing
01:28:05FromGitter<Quelklef> tbh I know minimal theory and just thought it'd be a cool thing to make
01:34:46*dddddd quit (Remote host closed the connection)
01:35:22*devdri quit ()
01:49:53*MJCaley joined #nim
02:33:03*vlad1777d quit (Ping timeout: 248 seconds)
02:33:20*vivus quit (Quit: Leaving)
02:57:53*chemist69 quit (Ping timeout: 265 seconds)
03:11:06*chemist69 joined #nim
03:14:03FromGitter<Varriount> I wonder what kind of parser could parse Nim code
03:14:21FromGitter<Quelklef> A Nim parser :-P
03:14:55FromGitter<Quelklef> Could ask what kind the current one is
03:15:14FromGitter<Varriount> Current one is manually written
03:15:27FromGitter<Varriount> Araq is against parser generators
03:15:35FromGitter<Quelklef> Prolly still fits into a classification tho, ye?
03:32:35*arthurz joined #nim
03:34:59*arthur joined #nim
03:35:23*arthur is now known as Guest13415
03:35:39*Guest13415 left #nim (#nim)
03:58:48*zarthur joined #nim
03:59:19*zarthur quit (Client Quit)
03:59:19*arthurz quit (Quit: Leaving)
04:00:12*arthurz joined #nim
04:02:15*thomasross_ joined #nim
04:02:46*thomasross_ quit (Max SendQ exceeded)
04:03:15*thomasross_ joined #nim
04:04:47*thomasross quit (Ping timeout: 248 seconds)
04:08:57*MJCaley quit (Quit: MJCaley)
04:21:03*MJCaley joined #nim
04:23:22*arthur joined #nim
04:23:46*arthur is now known as Guest59416
04:25:39*arthurz quit (Ping timeout: 246 seconds)
04:31:21*MJCaley quit (Quit: MJCaley)
04:35:05*Guest59416 is now known as arthurz
04:36:16*endragor joined #nim
04:37:12*MJCaley joined #nim
04:40:42*endragor quit (Ping timeout: 246 seconds)
04:47:23*arthurz quit (Quit: Leaving)
04:49:47*MJCaley quit (Quit: MJCaley)
05:03:07*sz0 joined #nim
05:19:19*endragor joined #nim
05:20:25*endragor quit (Remote host closed the connection)
05:20:33*endragor joined #nim
05:26:25*UxerUospr quit (Quit: Lost terminal)
05:37:29*yglukhov joined #nim
05:37:31*user0 quit (Quit: user0)
05:38:09*endragor quit (Remote host closed the connection)
05:39:25*endragor joined #nim
05:41:11*qwertfisch quit (Ping timeout: 240 seconds)
05:41:43*qwertfisch joined #nim
05:42:21*yglukhov quit (Ping timeout: 264 seconds)
06:06:15*tefter quit (Remote host closed the connection)
06:22:19*endragor quit (Remote host closed the connection)
06:24:32*endragor joined #nim
06:54:48*Guest60668 joined #nim
06:54:52Guest60668Check out this new language, it is better than Nim. https://www.ponylang.org
06:55:52Guest60668see ya
06:56:32FromGitter<Quelklef> uh
06:56:46Guest60668what?
06:57:24FromGitter<Quelklef> ...why
06:57:30Guest60668Nim has a bad philosophy is it even has one, also, what the hell happens with the unsigned ints in Nim?
06:57:38Guest60668if* it
06:57:48FromGitter<Quelklef> what do you mean what happens
06:57:50FromGitter<Quelklef> they're unsigned
06:57:56FromGitter<Quelklef> they're a data typ
06:58:21Guest60668But i can't even get the max value of an unint64
06:58:44FromGitter<Quelklef> Also I've found the Nim philosophy to be a very pragmatic and, frankly, refreshing one
06:58:49Guest60668and the admins hates me, they didn't want to help me and they called me troll
06:59:11FromGitter<Quelklef> ... probably because you come on and advertise other languages
06:59:56Guest60668How would you get the max value of an unint64?
07:00:11Guest60668i bet you can't
07:00:14FromGitter<Quelklef> Dunno, I don't need to
07:00:31Guest60668you would need to hard code it i guess
07:00:31FromGitter<Quelklef> Hardcode it. `.high` doesn't work, I assume because it's an Ordinal type
07:00:33FromGitter<Quelklef> but remember:
07:00:37FromGitter<Quelklef> Nim is in development
07:00:43Guest60668okay
07:00:47FromGitter<Quelklef> and it has incredibly amazing other features which matter much more than `.high`
07:01:05Guest60668like which one?
07:01:27FromGitter<Quelklef> idk, how about:
07:01:40FromGitter<Quelklef> incredibly powerful and flexible metaprogramming
07:01:50FromGitter<Quelklef> easy to use metaprogramming (templates)
07:01:55FromGitter<Quelklef> c-like speed
07:02:09FromGitter<Quelklef> efficient compiling (only compiling referenced procs)
07:02:25FromGitter<Quelklef> a robust type system that manages to work without the overhead of, say, interfaces
07:02:35FromGitter<Quelklef> closures
07:02:47FromGitter<Quelklef> exceptions
07:03:04Guest60668is it data-race free?
07:03:16FromGitter<Quelklef> a type system which doesn't encourage mutation
07:03:35FromGitter<Quelklef> Look, buddy, I don't know what that means, and I don't really care. Don't come to the Nim IRC to diss Nim, please
07:03:42Guest60668is it type safe and memory safe?
07:03:55Guest60668why you get mad? we are just talking
07:04:27Guest60668i was just asking you
07:04:28FromGitter<Quelklef> It sure is, unless you want it to not be (right, did I mention interfacing with C, optionally manually dealing with GC, ref, var, ptr, ...)
07:05:51FromGitter<Quelklef> I'm not mad per se, I'm just calling you out for being rude
07:06:20*solitudesf joined #nim
07:06:52Guest60668well Pony compiles with LLVM, and Pony programs can natively call C libraries, also the compiler is able to generate C header files for Pony libraries so C/C++ programs can natively call Pony programs
07:06:59FromGitter<Quelklef> \
07:07:04FromGitter<Quelklef> Oops, that was my cat
07:07:12Guest60668cute cat
07:07:19FromGitter<Quelklef> Yeah, but this isn't the Gitter for Pony
07:07:41FromGitter<Quelklef> sorry, you're on IRC. This isn't the IRC room for Pony
07:07:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
07:08:19Guest60668also, i think pony is more cute than Nim, cuz Nim has python's syntax but it feels like to program in C/C++ anyway
07:09:02Guest60668then basically Nim is pure syntactic sugar
07:09:08Guest60668true?
07:09:17FromGitter<Quelklef> Any compiled language could be called "pure syntactic sugar"
07:09:37Guest60668but Nim is just C with another syntax
07:09:41FromGitter<Quelklef> er, no
07:09:51Guest60668okay
07:10:18Guest60668why the developer hates the unsigned ints tho? he thinks he is the only one who use the language
07:10:29Guest60668it is like he doesn't give a fuck about the users
07:10:34FromGitter<qqtop> Well guest60668 it is time to pony up, before being banned from here , alternatively you could contribute an idea and some corresponding code.
07:10:47FromGitter<Quelklef> What is your goal here, man
07:10:52FromGitter<Quelklef> revenge on the devs?
07:11:22Guest60668To show a better language?, also when the hell will Nim become post-1.0
07:11:32FromGitter<Quelklef> but why
07:11:33FromGitter<Quelklef> O
07:11:43FromGitter<Quelklef> I think most people here are
07:11:46FromGitter<Quelklef> that's why we're here
07:12:16Guest60668are you a contributor?
07:12:28FromGitter<Quelklef> In a sense
07:13:04Guest60668Okay
07:13:12Guest60668have you made something in Nim?
07:13:19FromGitter<Quelklef> yup
07:14:05*sz0 quit (Quit: Connection closed for inactivity)
07:14:08Guest60668why should i choose Nim over Pony?, Pony's philosophy is defined and it is written on their website, where can i read Nim's philosophy?
07:14:49FromGitter<Quelklef> Does it matter? I never read about Nim's philosophy. I was looking for a language that was "type-safe Python" and found Nim, which turned out to be much more
07:15:06Guest60668Nim is not really type safe
07:15:11FromGitter<Quelklef> I tried the language out, I loved it, end of story
07:15:15FromGitter<Quelklef> Why's that?
07:15:22Guest60668because it has Nil
07:15:33FromGitter<Quelklef> That doesn't mean it isn't type safe, man
07:15:42FromGitter<Quelklef> It just means you have to do nil checks
07:15:53FromGitter<Quelklef> for, like, 6 types. Is Java also not type safe?
07:16:02FromGitter<SolitudeSF> well, pack it up boys, we found better language, lul
07:16:08FromGitter<Quelklef> for real lol
07:16:18FromGitter<Quelklef> may as well just cease development here and now
07:17:33Guest60668do you have proof Nim is really type safe?, in PonyLang's website, they posted a document with a mathematical proof about their type safety
07:18:02FromGitter<Quelklef> The proof is in the putting
07:18:07FromGitter<Quelklef> I put bad type in, I get bad type out
07:18:20Guest60668and Nim's multithreading sucks?
07:18:30FromGitter<Quelklef> never needed it, never used it
07:18:34Guest60668i heard it is a pain in the ass
07:18:44FromGitter<Quelklef> you heard
07:19:05Guest60668that is the problem, the developers of Nim just care about what they need
07:19:17FromGitter<Quelklef> good point
07:19:25FromGitter<Quelklef> write me a mathematical proof that that's the issue, and I'll listen to you
07:20:23Guest60668Well just go to Nim's github repository, and read what they talk there
07:20:35FromGitter<Quelklef> I've spoken with the devs
07:20:38Guest60668they are selfish developers
07:21:01FromGitter<Quelklef> They seem pretty reasonable from what I've read from them and my experiences with them
07:21:14FromGitter<Quelklef> not to mention helpful, spending time in this chat room to help the users out :]
07:24:00*miran joined #nim
07:25:19*Guest60668 quit (Ping timeout: 256 seconds)
07:34:02*yglukhov joined #nim
07:34:56*yglukhov quit (Remote host closed the connection)
08:02:49FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a644929ce68c3bc74e3fb94]
08:03:19miranchange let to var?
08:03:31FromGitter<Bennyelg> I tried it
08:03:37FromGitter<Bennyelg> it was my first check
08:03:47FromGitter<Bennyelg> i forgot to change it before post my question
08:05:23FromGitter<Bennyelg> ```code paste, see link``` ⏎ ⏎ try it [https://gitter.im/nim-lang/Nim?at=5a6449c3290a1f4561b5fa40]
08:07:23*dddddd joined #nim
08:07:52miranyou have some typos - gussedTypes and guEssedTypes
08:09:49miranafter that, it works but the logic seems wrong to me
08:13:08miranhere you go: https://play.nim-lang.org/?gist=166584dd5f088df0e45c029592ccf54a
08:14:46*miran quit (Remote host closed the connection)
08:16:01*miran joined #nim
08:19:38*yglukhov joined #nim
08:48:55FromGitter<Bennyelg> Thanks
08:53:47*yglukhov quit (Remote host closed the connection)
09:02:03*nsf joined #nim
09:02:43FromGitter<data-man> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a645733ba39a53f1a40fd97]
09:02:50*gmpreussner quit (Ping timeout: 260 seconds)
09:05:45*gmpreussner joined #nim
09:12:23*endragor quit (Remote host closed the connection)
09:13:53*endragor joined #nim
09:18:30Araqhmmm I'm selfish
09:19:51FromGitter<Bennyelg> nice
09:19:55FromGitter<Bennyelg> @Araq
09:24:17*yglukhov joined #nim
09:28:51*yglukhov quit (Ping timeout: 256 seconds)
09:31:19endragorhow do you make a cstring literal with escape sequences (e.g. line ending?)
09:32:09Araqcstring("\n")
09:32:19endragordoesn't that create a string first?
09:33:21Araqthe conversion happens at compiletime
09:33:31Araqtechnically you're right
09:33:55FromGitter<tim-st> Does anyone knows of a working leveldb or rocksdb wrapper for nim?
09:35:41endragor@Araq ok, thanks :)
09:36:02*BitPuffin joined #nim
09:38:36FromGitter<data-man> @tim-st: https://github.com/zielmicha/leveldb.nim ?
09:39:07FromGitter<tim-st> I read the source code. No mention of dll or c sources, how should I use it?
09:40:09FromGitter<tim-st> there is only `{.passl: "-lleveldb".}` dont know if that's a hint
09:41:21FromGitter<tim-st> Is it hard to create a nim interface from the official rocksdb java JNI class?
09:41:31FromGitter<tim-st> that loads the dll
09:43:34FromGitter<data-man> https://github.com/singularperturbation/nim-leveldb
09:43:53FromGitter<tim-st> `(HIGH LEVEL WRAPPER STILL NEEDS TO BE WRITTEN)`
09:44:00*Yardanico joined #nim
09:44:17FromGitter<tim-st> It says. So basically it doesnt exist :(
09:44:56Araq-lldeveldb essentially means "Unix only"
09:45:54FromGitter<tim-st> ok, thanks
09:48:22*arecaceae quit (Remote host closed the connection)
09:48:40*arecaceae joined #nim
10:00:43*thomasross_ quit (Read error: Connection reset by peer)
10:01:14*thomasross_ joined #nim
10:01:44*thomasross_ quit (Max SendQ exceeded)
10:02:12*rauss quit (Read error: Connection reset by peer)
10:02:14*thomasross_ joined #nim
10:04:40*rauss joined #nim
10:05:17*yglukhov joined #nim
10:07:29FromGitter<Bennyelg> @data-man template tryCast(r: untyped, y: proc): bool = ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a646661ce68c3bc74e4794c]
10:08:21FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a646695e01412265070b8f0]
10:09:10FromGitter<data-man> @Bennyelg: Bench an implementations :)
10:09:39*yglukhov quit (Ping timeout: 256 seconds)
10:09:42FromGitter<Bennyelg> hehe
10:10:08*vlad1777d joined #nim
10:10:52*devdri joined #nim
10:15:04FromGitter<tim-st> @data-man The second url you provided works on windows, thanks! Only 2 procs would be needed to have the wrapper complete without these c strings
10:19:14FromGitter<data-man> @tim-st: Good, no problem! Fork it. :)
10:20:00FromGitter<tim-st> I would do it, I have no idea how to interface between these types and when I have to free memory and use pointers etc... :(
10:21:13*miran quit (Quit: Konversation terminated!)
10:21:13*nc-x joined #nim
10:24:57FromGitter<data-man> https://github.com/singularperturbation/nim-leveldb/blob/master/src/internal/tests.nim is a good start
10:26:10FromGitter<tim-st> Yes, I looked at it already, `copyMem(addr result[0], x, length[])` is already too much for me...
10:26:49*marenz_ joined #nim
10:28:24*nc-x quit (Ping timeout: 260 seconds)
10:28:51*user0 joined #nim
10:37:50*yglukhov joined #nim
10:42:21*yglukhov quit (Ping timeout: 264 seconds)
10:44:20*devdri quit ()
10:46:45*devdri joined #nim
11:02:57*user0 quit (Ping timeout: 268 seconds)
11:05:59*user0 joined #nim
11:10:39FromGitter<dom96> Aww. I missed our troll.
11:26:58*Guest60770 joined #nim
11:27:09Guest60770Hi, i need help
11:27:16Guest60770can someone help me please?
11:27:29FromGitter<Bennyelg> what do you need
11:27:48Guest60770i want to know why pony lang is better than nim :V
11:28:10FromGitter<Bennyelg> sorry I dont know what is pony lang
11:28:23Guest60770it is a better language
11:29:48Araqbecause of your mother.
11:29:59Guest60770i fucked yours yesterday
11:30:09Guest60770araq common, admit it
11:30:13Guest60770Nim sucks
11:30:18Guest60770it will never be popular
11:30:31FromGitter<Bennyelg> So what do you want?
11:30:32Guest60770because it is a creepy language
11:30:39FromGitter<Bennyelg> if you dont like it dont use it
11:30:39Araqmaybe never as popular as your mother.
11:30:45Guest60770sex with Araq's gf
11:30:51Guest60770or with his little sister
11:30:57FromGitter<Bennyelg> we already have plenty of bad programmers we dont need you abord
11:31:26Guest60770Nim you are fired
11:31:37Guest60770Pony you are hired
11:31:45FromGitter<Bennyelg> I bet Guest60770 think his rob stark
11:31:54FromGitter<Bennyelg> Hahahah 😄
11:32:20Guest60770Nim is for weirdos, Pony is for programmers XD
11:33:20Araqtoo bad neither is for you then.
11:33:23FromGitter<Bennyelg> I guess Guest60770 love to get is ass dicked well, and his probably didn't got is daily dic*k meal for today, let him wait @Araq`
11:33:59FromGitter<alehander42> @Guest60770 , mate, I suggest you write this stuff in a blog post and publish it, I am sure it will popularize Pony a lot
11:34:28FromGitter<Bennyelg> thats for sure :D
11:35:08FromGitter<alehander42> anyway, who can ban the guy, he's obvsly unstable
11:35:13Guest60770if you want to write brograms use Nim, if you want to write programs use Pony
11:35:57Guest60770i feel pity
11:36:06FromGitter<RayoGundead> what's a Brony (Guest60770) doing here?
11:36:09FromGitter<RayoGundead> you're in the wrong chat, degenerate horsefucker.
11:36:12Guest60770i feel pity for everyone who bought Nim in action book
11:36:25Guest60770XD
11:36:32FromGitter<Bennyelg> I feel happy to know why I should see pony lang lol
11:36:51Guest60770because it will change your life
11:36:53FromGitter<Bennyelg> if it attract idiots like you
11:36:55FromGitter<Bennyelg> HAhahaha
11:37:31Guest60770it is an interesing project unlike Nim, cuz Nim is just python + c++
11:38:00Guest60770where is the originality ?
11:38:05Guest60770XD
11:39:04Guest60770py++ would be a better name XD
11:39:33FromGitter<Bennyelg> we dont love "originality"
11:39:33Guest60770:V
11:39:39FromGitter<Bennyelg> we love nim
11:39:41FromGitter<alehander42> guys, don't feed him
11:39:42FromGitter<Bennyelg> you love pony
11:39:44FromGitter<Bennyelg> go to the chat
11:39:59FromGitter<RayoGundead> > https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md ⏎ ⏎ now I understand... ⏎ soyboys are invading Nim again with their SJWism push [https://gitter.im/nim-lang/Nim?at=5a647c0fce68c3bc74e4d535]
11:40:00Guest60770alehander42 i am Not hungry :V
11:41:56Guest60770the best Nim program ever:
11:42:06Guest60770echo "Nim sucks"
11:42:07Guest60770?
11:42:46Guest60770oh it is
11:42:55Guest60770echo("Pony Rulez")
11:43:12FromGitter<Bennyelg> are you 7 yo?
11:43:20Guest6077023
11:43:40Guest60770and i am pedophile
11:44:19Guest60770i am the most strange person you will ever meet online
11:45:31Guest60770who lives in USA?
11:45:35Guest60770i go to USA soon
11:47:10Guest60770i will go to Tennessee to kidnap my little girls
11:47:58Guest60770Cya guys, i am gonna learn Pony now :)
11:48:28*Guest60770 left #nim ("Leaving")
11:48:56FromGitter<dom96> Araq: can you not do that? And ban him instead?
11:49:17FromGitter<dom96> Btw guys, do this survey: https://twitter.com/jetbrains/status/948935309319983105
11:49:57FromGitter<dom96> Maybe they'll make a Nim IDE :)
11:51:02*yglukhov joined #nim
11:55:37*yglukhov quit (Ping timeout: 256 seconds)
11:56:39Yardanicojust ignore him :P
11:56:48Yardanicoah he leaved
11:56:51*couven92 joined #nim
11:58:48FromGitter<dom96> The responses are shocking imo. Fyi there is nothing wrong with being a brony.
11:58:52FromGitter<RayoGundead> he left
11:59:37FromGitter<dom96> Just because a troll comes in here gives you no excuse to act like him.
12:01:59FromGitter<RayoGundead> @dom96 MLPFIM was the first thing that came to my mind when he mentioned pony language
12:03:12FromGitter<RayoGundead> well, actors are nice for concurrency/multithread stuff ⏎ but it's also a design pattern that can be done in Nim
12:04:57FromGitter<RayoGundead> ..... and I'm actually a brony
12:06:12FromGitter<RayoGundead> weirdly he didn't see by my gitter avatar
12:07:16Yardanicodom96, compelted the survey :P
12:07:22Yardanico*completed
12:07:28FromGitter<Bennyelg> max, min form seq
12:07:38FromGitter<Bennyelg> there is something ready? or i should implement it
12:07:42Yardanico?
12:07:48Yardanicoyou need to get max or min value from seq?
12:08:07FromGitter<Bennyelg> yes but it's complex num tuple like
12:08:30FromGitter<Bennyelg> so it's seq[(int, int)] i need to get the max using by the first int of the tuple
12:08:43YardanicoBennyelg: you need to define `<` for your tuple
12:08:47Yardanicofor a tuple of this type
12:08:52Yardanicoand then "max" and "min" will use it
12:09:13FromGitter<Bennyelg> how i define something like that?
12:09:18FromGitter<Bennyelg> template?
12:09:23Yardanicojust a proc
12:09:28FromGitter<Bennyelg> ok
12:10:13Yardanicoproc `<`(a, b: (int, int)): bool = a[0] < b[0]
12:11:00FromGitter<alehander42> oh man that jetbrains survey is longer than a book
12:11:16Yardanicowell yeah :)
12:11:27FromGitter<alehander42> I think they asked me what is my favorite ide/editor like four times already
12:11:39FromGitter<alehander42> there are even questions about music style, but maybe I am hallucinating
12:14:22FromGitter<RayoGundead> enter "Power Metal"
12:14:34FromGitter<RayoGundead> they might add that genre in ther vlog
12:18:11FromGitter<alehander42> "the gang builds a Power Metal IDE"
12:31:46FromGitter<Bennyelg> ```code paste, see link``` ⏎ ⏎ t1(a) not working its expecting the option string which I want it to be optional like scala [https://gitter.im/nim-lang/Nim?at=5a648832ce68c3bc74e505ab]
12:33:27FromGitter<ZarsBranchkin> @Bennyelg For optional arguments you must define it's default value
12:34:24FromGitter<ZarsBranchkin> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6488d0290a1f4561b70957]
12:34:49FromGitter<ZarsBranchkin> Or whatever is the way you initialize options
12:35:10FromGitter<Bennyelg> thanks
12:38:39*devdri quit ()
12:40:30FromGitter<Bennyelg> @ZarsBranchkin undeclared newOption()
12:40:51FromGitter<ZarsBranchkin> well yeah, that's not a thing by default
12:43:25FromGitter<ZarsBranchkin> Hm, if it's the Option that comes from here https://nim-lang.org/docs/options.html then I guess you'd use: ⏎ ⏎ ```proc t1(csvTypes: seq[string], header: Option[string] = none(string)) =``` [https://gitter.im/nim-lang/Nim?at=5a648aec5ade18be39a34a77]
12:43:44FromGitter<ZarsBranchkin> @Bennyelg
12:44:18FromGitter<Bennyelg> @ZarsBranchkin thanks I just saw that in the options lib
12:44:25*Vladar joined #nim
12:52:22*yglukhov joined #nim
12:54:06*devdri joined #nim
12:56:39*yglukhov quit (Ping timeout: 246 seconds)
12:57:43*dddddd_ joined #nim
12:59:27*dddddd quit (Ping timeout: 240 seconds)
13:00:20*dddddd_ is now known as dddddd
13:10:47*devdri quit ()
13:14:34FromGitter<Bennyelg> Question: ⏎ How do I formatting a seq of tuples to a string ?
13:14:53FromGitter<Bennyelg> I tried using join(",") but it's not working it's leave the bad format of the tuples
13:15:10FromGitter<Bennyelg> (a: "x", b: "1"),(a: "y", b: "2"),...
13:17:50FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6492feba39a53f1a41f920]
13:17:55FromGitter<Bennyelg> better way?
13:31:32*yglukhov joined #nim
13:35:35*yglukhov quit (Ping timeout: 240 seconds)
13:35:52FromGitter<Bennyelg> how to get a value from a shell execute command ?
13:38:00FromGitter<ZarsBranchkin> @Bennyelg this seems like it https://nim-lang.org/docs/osproc.html#execCmdEx,string,set[ProcessOption]
13:42:45FromGitter<data-man> @Bennyelg ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a6498d55ade18be39a3880a]
13:53:14*PMunch joined #nim
13:59:41*Snircle joined #nim
14:12:00*Yardanico quit (Remote host closed the connection)
14:13:01*Yardanico joined #nim
14:13:15*Yardanico quit (Remote host closed the connection)
14:15:53PMunchHmm, is there any existing module to parse a C-like struct format?
14:20:53FromGitter<data-man> @PMunch: What is it "C-like struct format"? :)
14:21:47PMunchWell I'm thinking of writing a pure-Nim library for protobuf: https://developers.google.com/protocol-buffers/docs/proto3
14:22:05PMunchAnd the way you specify protobuf formats are a C-like format
14:23:02FromGitter<data-man> cparse.nim from c2nim?
14:24:34PMunchYeah I was looking at that..
14:24:51PMunchSeems a bit of an overkill though..
14:25:27*Cthalupa quit (Ping timeout: 240 seconds)
14:25:30PMunchEh, I guess I'll write my own. That way I can also validate that it's actually a protobuf file
14:29:52*Cthalupa joined #nim
14:33:15*yglukhov joined #nim
14:33:18FromGitter<data-man> "The idea is there locked inside. All you have to do is remove the excess stone." Michelangelo.
14:34:55FromGitter<tim-st> I now have open, close, get, contains, put and delete working for leveldb dll version, that's enough for now :)
14:35:08PMunchNice
14:36:13*natrys joined #nim
14:37:27*yglukhov quit (Ping timeout: 240 seconds)
14:38:20*Snircle quit (Ping timeout: 276 seconds)
14:45:07*Yardanico joined #nim
14:47:53FromGitter<data-man> @PMunch: About Michelangelo? Or about leveldb? :)
14:58:45FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a64aaa55a9ebe4f75b5d586]
15:05:45*yglukhov joined #nim
15:09:49FromGitter<Bennyelg> I assume it's because the MaxThreadPoolSize = 256
15:09:51FromGitter<Bennyelg> ?
15:09:57*yglukhov quit (Ping timeout: 240 seconds)
15:20:53*xkapastel joined #nim
15:20:54*MJCaley joined #nim
15:23:15*adeohluwa joined #nim
15:28:54*Snircle joined #nim
15:33:29*miran joined #nim
15:38:31*Yardanico_ joined #nim
15:41:44FromGitter<data-man> @Bennyelg: I can't repeat your error. Tested it with 100000 rows.
15:43:20*Snircle quit (Ping timeout: 276 seconds)
15:44:07*MJCaley quit (Quit: MJCaley)
15:45:48*Snircle joined #nim
15:50:09*llll joined #nim
15:51:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
15:55:31PMunchdata-man, I was referencing leveldb. But it's a good quote :)
16:00:53llllgb
16:00:56*llll quit (Quit: Page closed)
16:01:15FromGitter<Bennyelg> Interesting I have no Idea why its fails
16:05:32*MJCaley joined #nim
16:06:02FromGitter<Bennyelg> @data-man how did you open sqlite conn?
16:06:32FromGitter<Bennyelg> I open memory connection and not a disk
16:08:20FromGitter<tim-st> When I expect cuchar(1) how should I compare it? should I use c.ord() == 1 or is there a better way?
16:11:35FromGitter<data-man> @Bennyelg: With ":memory:" also not reproduced.
16:15:28*yglukhov joined #nim
16:17:07*Snircle joined #nim
16:17:23*Snircle quit (Client Quit)
16:19:35*yglukhov quit (Ping timeout: 240 seconds)
16:21:28*Yardanico_ quit (Quit: Leaving)
16:25:48FromGitter<tim-st> Does someone knows the equivalent of Golangs `C.GoBytes(unsafe.Pointer(data), C.int(len))` for nim?
16:26:29FromGitter<tim-st> When I just use `$` there is a bit garbage in the string
16:28:55FromGitter<Bennyelg> I can understand why Im failing
16:32:26FromGitter<Bennyelg> After few chunks I get ⏎ Illegal storage access. (Attempt to read from nil?)
16:32:43FromGitter<Bennyelg> this error drove me crazy
16:39:00*Yardanico_ joined #nim
16:39:15FromGitter<Bennyelg> How I can investigate: ⏎ ⏎ ```SIGSEGV: Illegal storage access.``` [https://gitter.im/nim-lang/Nim?at=5a64c232ba39a53f1a42c876]
16:39:27dom96tim-st: you can setLen on the string, maybe that would help?
16:40:05*Yardanico quit (Ping timeout: 256 seconds)
16:41:51FromGitter<tim-st> @dom96 I will try it. I now created procs for it and copied the identical code into it and it works, now^^
16:42:15*Ven`` joined #nim
16:44:42FromGitter<tim-st> No, it only works on the reverseIterator not the normal one, maybe it's not my mistake
16:45:09FromGitter<Bennyelg> @data-man When I os.sleep(1) I did manage to put alot more records before it failed
16:45:27FromGitter<Bennyelg> maybe my memory is corrupted :d ?
16:48:55FromGitter<tim-st> @dom96 wow, it really works with setLen, thanks! But it feels like performance loss isnt it?
16:49:25FromGitter<tim-st> should I free the cstring before casting to string?
16:49:26dom96Why do you think that?
16:49:55FromGitter<tim-st> because I already get the pointer to a string and I create a new one using $cstring
16:50:15dom96good question, I'm not sure whether converting a cstring to string copies the string
16:50:43FromGitter<tim-st> thanks, do you know if I have to free the returnt cstring?
16:51:05dom96that would require knowing whether `$` copies the cstring :)
16:51:10dom96you can probably check that
16:51:13dom96using repr
16:51:26FromGitter<tim-st> ok, mom
16:51:31dom96check if `addr str[0]` points to the same address
16:51:39dom96I'm not your mom lol
16:51:59FromGitter<tim-st> in German it means moment^^
16:52:03FromGitter<tim-st> wait a moment
16:52:16*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:52:22FromGitter<Clyybber> never seen that abbreviaton lol
16:52:31*Ven`` joined #nim
16:52:40miranhe just made that up :P
16:53:01FromGitter<tim-st> It's really not good to use in english^^
16:53:06dom96lol yeah
16:53:39FromGitter<Clyybber> never seen it in german either 😄
16:53:44FromGitter<tim-st> sure
16:54:19FromGitter<Clyybber> btw did github give u that sad face avatar?
16:54:39FromGitter<tim-st> yes^^
16:55:20FromGitter<Clyybber> wow i call that lucky
16:55:26FromGitter<Clyybber> or rather the opposite
16:56:11FromGitter<Clyybber> i wonder what they use to determine the avatar
16:56:55FromGitter<tim-st> @dom96 which one should I use? echo repr(keyC) ⏎ echo repr(key) ⏎ echo addr keyC[0] ⏎ echo addr key[0] [https://gitter.im/nim-lang/Nim?at=5a64c657e014122650726590]
16:57:20FromGitter<tim-st> repr is different
17:05:49FromGitter<tim-st> So the address is different but I read in the golang version that at this point there is no need for freeing the memory because the closing proc does it
17:07:32*nsf quit (Quit: WeeChat 2.0.1)
17:07:39*MJCaley quit (Quit: MJCaley)
17:07:51*nsf joined #nim
17:12:30*endragor quit (Remote host closed the connection)
17:12:58*endragor joined #nim
17:13:54*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:16:29*merv joined #nim
17:17:19*endragor quit (Ping timeout: 248 seconds)
17:22:09*merv quit (Quit: Page closed)
17:22:35*MJCaley joined #nim
17:25:12*endragor joined #nim
17:26:36*yglukhov joined #nim
17:29:18*endragor quit (Ping timeout: 246 seconds)
17:31:11*yglukhov quit (Ping timeout: 248 seconds)
17:31:32*Ven`` joined #nim
17:32:27*gmpreussner quit (Ping timeout: 240 seconds)
17:32:53FromGitter<Quelklef> By the way, is the behavior of `import` planned to change, or stay as-is?
17:33:05*gmpreussner joined #nim
17:33:52FromGitter<Quelklef> More specifically, the behavior that `import A` includes everything from `A` into the current namespace
17:42:37miranwon't change afaik
17:42:54*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:43:14miranyou get used to it after some time....
17:43:53FromGitter<Quelklef> yeah
17:44:39FromGitter<Quelklef> I mean, I use it, I'm fine with it, it makes it nicer to work within a closed environment / project easily
17:44:49FromGitter<Quelklef> but also makes it harder to read code which is my main issue
17:45:16FromGitter<Quelklef> then again i can always `from A import nil`
17:59:44FromGitter<ZarsBranchkin> I try to keep the `A.proc()`notation, so it's clear from where I got the procedure. I guess exception could be a huge library like SDL, where I won't want to prefix the library name to all the procedures which are obviously imported
18:02:31FromGitter<Quelklef> or operators
18:02:50FromGitter<Quelklef> `result = misc.>$ text`
18:04:16FromGitter<Quelklef> I've noticed also that if two module's namespaces clash the compiler won't complain unless you actually make am ambiguous call
18:04:39FromGitter<Quelklef> Which makes a lot of sense but also is kind of weird. I know if I were writing a language I would have (thoughtlessly) made it complain on import
18:04:45FromGitter<Clyybber> That should give at least a warning IMO
18:04:52FromGitter<Quelklef> I don't think so tbh
18:05:10FromGitter<Quelklef> I've noticed this kind of thing seems to be a trend in the language
18:05:26FromGitter<Quelklef> You can write procs with conflicting types, etc., etc. and it won't complain until you try to use them
18:05:54FromGitter<Quelklef> which I thought was weird at first but I actually kind of like now because it's like, "We don't care if it doesn't work if you don't use it"
18:06:06FromGitter<Clyybber> Hmm
18:06:11FromGitter<Quelklef> Perhaps an issue when writing a library or something, but then you can write tests
18:06:27FromGitter<Quelklef> it's like how procs that aren't used aren't compiled
18:06:39FromGitter<Quelklef> idk. Idk if other languages do this but I feel like they generally don't
18:07:50FromGitter<Clyybber> Yeah, i concur. This is better suited for a linter to check or something like that
18:08:49FromGitter<Quelklef> Speaking of which, what's the most comprehensive editor from Nim rn?
18:09:02FromGitter<Quelklef> I'm using Sublime text + Nimline which is pretty great but not perfect
18:09:23FromGitter<Clyybber> I use kakoune but thats really only a editor and far from an IDE
18:09:30FromGitter<Clyybber> but it has Nim support
18:09:33FromGitter<Clyybber> so thats cool
18:09:56FromGitter<Clyybber> and a linter can be plugged in too
18:10:04FromGitter<ZarsBranchkin> Been using Nim with spacemacs. Thanks to the nimsuggest, the suggestions and quick documentation is pretty nicely supported
18:10:04FromGitter<Quelklef> I can't handle command-line editors :[
18:10:05dom96What's the reason for giving a warning in that instance?
18:10:11FromGitter<Quelklef> I *need* to scroll, man. Lol
18:10:54FromGitter<Quelklef> "The best editor is neither Emacs nor Vim, it's Emacs and Vim!" Chaotic good
18:11:42FromGitter<ZarsBranchkin> Oh yes, best combination. Couldn't use vim, as it was annoying to tweak and i found it hard to use on bigger projects
18:12:09FromGitter<ZarsBranchkin> Luckily emacs provides darn solid IDE and spacemacs configuration integrates vim keybindings into emacs so well
18:12:25dom96TIL of kakoune
18:12:32FromGitter<Clyybber> its really good
18:12:37dom96I'm the same as Quelklef though
18:12:38FromGitter<Clyybber> can only recommend
18:13:23*MJCaley quit (Quit: MJCaley)
18:13:27dom96I prefer editors that adopt the operating system's editing capabilities and extend them
18:13:34FromGitter<Clyybber> dom96 A warning could help forsee problems in the planning phase of a projects
18:13:35dom96instead of coming up with their own weird conventions :)
18:14:06FromGitter<Clyybber> Kakoune actually kinda does this, by sticking to the UNIX way
18:14:13dom96Clyybber: two symbols conflicting isn't a problem though. You just disambiguate :)
18:14:35FromGitter<Clyybber> yes true
18:14:48miranQuelklef: i'm using vscode with nim plugin
18:14:50FromGitter<Clyybber> thats why i concur
18:14:58FromGitter<ZarsBranchkin> Luckily emacs GUI does support mouse events, but I've heard the whole graphical interface is basically a hacked together terminal interface onto X windows
18:15:15adeohluwais payments via ussd a good idea?
18:15:32adeohluwalike very feasible & no security issues
18:17:20FromGitter<Clyybber> @ZarsBranchkin correct me if im wrong here but AFAIK emacs supports basic mouse input in the console too
18:17:48*Trustable joined #nim
18:17:55FromGitter<Clyybber> at least in xterm
18:18:46FromGitter<ZarsBranchkin> Right, yeah, works for me too
18:19:17FromGitter<ZarsBranchkin> Don't really use emacs in terminal, I usually just use vim when I need to edit few things from terminal quickly
18:20:58FromGitter<Bennyelg> Nim docker: Error: cannot open 'templates'
18:21:05FromGitter<Bennyelg> when try to compile file
18:21:48*yglukhov joined #nim
18:23:35dom96adeohluwa: ussd?
18:23:54PMunchdom96, yeah I looked into Kakoune a while back. Looks really interesting with the solid multi-selection edit
18:24:16PMunchBut I had just "finished" setting up my Vim so I couldn't bring myself to switch at that point :P
18:25:37PMunchAnd Vim supports the mouse just fine if you set it up right. Scrolling, selecting, copy-paste with middle mouse button on Linux, all that stuff.
18:26:03miranPMunch: is kakoune still under heavy development or is it ready for some general use (as a main editor)?
18:26:07*yglukhov quit (Ping timeout: 248 seconds)
18:26:20PMunchmiran, haven't used it much but it seemed pretty solid to me
18:26:31FromGitter<Clyybber> It is perfectly usable as far as i have used it
18:27:29miranok, why would one use kakoune istead of: (1) vim, (2) vscode?
18:27:40miranwhat are the advantages of it?
18:27:42FromGitter<Clyybber> it has a simpler codebase
18:27:51FromGitter<Clyybber> though neovim has that too
18:28:04FromGitter<Clyybber> it is more lightweight than vscode
18:28:48miraneverything is more lightweight than vscode :P any other advantages?
18:29:02FromGitter<Clyybber> i find the design makes much more sense
18:29:06PMunchkakoune has multi-selection support like Sublime
18:29:18FromGitter<Clyybber> as in better keyboard shortcuts
18:29:45PMunchAnd yeah, easier to use and better keyboard shortcuts are touted, although I haven't used it enough to verify
18:29:54FromGitter<Clyybber> and i find the multi selection as the main concept thing pretty elegant
18:29:57PMunchIt does outperform Vim at vim-golf though :P
18:30:13miranPMunch: i often hear about sublime's multi-selection - vscode also has it, but usually sublime is mentioned - what is so unique about it?
18:30:21adeohluwadom96: yes ussd , doesn't make sense to u?
18:30:22FromGitter<Clyybber> @PMunch yes thats the byproduct of good features
18:30:26PMunchYeah, that way of editing text feels much more natural to me than recordings and regexes like Vim uses
18:30:51mirani use vim plugin in vscode, and so far i'm satisfied with it
18:31:12miranbut i'm open to trying new things
18:31:12FromGitter<Clyybber> well, if it works...
18:31:26PMunchmiran, well the capabilities in vscode is pretty similar to Sublimes. It was just that Sublime was the first one to have them and that was their key selling point (if not the first then at least the first well known)
18:31:58PMunchThe benefit of multi-selection edit is that you can easily take one piece of formatted data and transform it into something else
18:32:00dom96adeohluwa: no
18:32:24PMunchOnce you get used to having it though it is a really powerful tool
18:32:30mirandom96: adeohluwa: usd? us dollars?
18:32:42adeohluwaoh!!
18:32:45PMunchI've got a plugin for Vim that makes me do some of the things, but it's not perfect and a bit finicky at times
18:32:52adeohluwamaybe its not a thing over there
18:33:00adeohluwaI mean codes like
18:33:07adeohluwa*99*2#
18:33:13adeohluwaon mobile phones
18:33:23PMunchadeohluwa, oh wow. Haven't used those in a while :P
18:33:44PMunchHmm, for payments though..
18:34:10adeohluwaPMunch: gets passed on by everyone
18:34:23adeohluwabut pretty convenient for most users
18:34:36PMunchWell, they're a pain to type..
18:35:34PMunchWhat a USSD code does is just tell the network that this message is not to be interpreted as a phone number and rather to handle it internally on the SIM (which then might initiate other things). So I guess if you had a SIM with a trusted area you could do some USSD payment stuff but you'd probably have to be a teleco to do that ..
18:38:18PMunchHuh apparently India uses USSD payments
18:39:11FromGitter<tim-st> If I want a proc `serialize[T] -> string` that can take any possible type and marshalls to string, is that possible? how would be the signature?
18:39:39FromGitter<tim-st> and the fitting deserialize that defaults to nil
18:39:58FromGitter<Quelklef> How would that work?
18:40:10FromGitter<Quelklef> You'd need to be able to iterate over all of the object's fields, ye?
18:40:15PMunchproc serialize[T](input: T): string
18:40:18FromGitter<tim-st> the marshal package can do it
18:40:20PMunchSomething like that probably
18:40:31FromGitter<Quelklef> why not just use the marshal package then
18:40:53FromGitter<tim-st> I want to ship the proc with my lib to work out of the box
18:41:02FromGitter<Quelklef> but
18:41:09FromGitter<Quelklef> if the marshal's one works with any type
18:41:12FromGitter<Quelklef> why do you need one for your type
18:41:41adeohluwaPMunch: or have a relationship with a telco
18:41:43FromGitter<tim-st> because there is logic behind, how to call it
18:41:54adeohluwanot every country has rock solid internet
18:41:58PMunchadeohluwa, well yeah of course
18:42:48adeohluwaI just wanna get card details & then submit that automatically via some payment API
18:43:17PMunch"just"
18:43:31adeohluwaLmao!
18:43:53adeohluwaI'm implying its supposed to be simple , its 2018
18:43:57FromGitter<data-man> emacs, vim, kakoune... ⏎ eon! :) https://github.com/tomas/eon
18:45:41PMunchWe should write our own terminal editor in Nim :)
18:45:41adeohluwaI definitely find ussd easier than going to some website & completing multiple steps not forgetting ADs everywhere
18:46:19PMunchHmm, I think you and I have very different experiences with USSD :P
18:46:45adeohluwamust have bn pretty horrible for u
18:48:24*c0ntribut0r joined #nim
18:48:30mirandata-man: oh, another editor....
18:50:11mirani should better start writing/editing things are should be doing, and not just watch gifs of various editors....
18:54:05PMunchHmm, now for something completely different (we can get back to editors afterwards)
18:54:59PMunchI want to parse a file in Nim. A unit can start with one of two categories. I want to first sort them by category then handle the categories by themselves
18:55:44PMunchSo I was thinking of having a set of strings and do something like if token in union(class1, class2)
18:55:51PMunchBut Nim sets can only be ordinals
18:56:15PMunchI can use a set from the sets module, but that seems a bit overkill since I'm not going to insert anything in these
19:13:23PMunchHmm, maybe one large enum with all the tokens in it and then some const sets to group them?
19:15:10dom96that sounds like a good plan
19:15:14dom96what is this for?
19:15:15dom96protobuf?
19:15:24PMunchYup
19:15:41dom96The answer is simple: if the categories are pre-defined then use an enum
19:15:47dom96if they are entirely arbitrary then don't
19:16:07PMunchOh yeah they are pre-defined
19:16:33PMunchThis is for all types and keywords that can be found in the .proto file
19:18:04dom96then enum
19:18:08dom96definitely the way to go
19:18:27PMunchYeah I realized as well
19:18:46dom96also do try to keep the parser separate so others can make use of it if necessary :)
19:18:54PMunchGood idea
19:19:03PMunchWell
19:19:22PMunchThe parser in protobuf generally converts to code to read and write a Protobuf message..
19:19:45PMunchThe others do this by a separate tool but for Nim I was planning on just making it a macro that takes a string
19:19:58PMunchSo either statically read a file or inline the definition
19:20:21PMunchBut I might parse it to a subtype first..
19:20:55dom96You should create an AST-like structure for protobuf
19:21:03dom96then create a macro that takes this as an input
19:21:21dom96and a separate parser that takes a string and gives you the AST as an output
19:21:30*onionhammer quit (Quit: WeeChat 1.9.1)
19:21:36PMunchHmm, yeah I guess..
19:22:03PMunchThat way you could theoretically load a proto file on runtime as well
19:22:21PMunchIf you wrote a generic reader for any AST
19:25:51FromGitter<tim-st> Now I found out why my deserialize proc didnt work: I can not call `a.procnameT (b)` but in this situation I am forced to use `procnameT (a,b)`
19:25:59FromGitter<tim-st> is this a bug @Araq ?
19:27:11dom96it is
19:27:12*fredrik92 joined #nim
19:27:23dom96not really a bug
19:27:30dom96more of a language gotcha you need to be aware of
19:27:48FromGitter<tim-st> Well at least the error message is wrong
19:27:57FromGitter<tim-st> and lead me in the totally wring direction
19:30:28*couven92 quit (Ping timeout: 268 seconds)
19:30:29FromGitter<tim-st> I now have leveldb implement with full json support working out of the box optionally for keys and values ;)
19:30:49FromGitter<tim-st> for any type
19:30:55*onionhammer joined #nim
19:30:59dom96actually now that I looked into it
19:31:11dom96I remembered that there was talk of implementing a new syntax for generics
19:31:21dom96to fix this: foo.blah[:T]()
19:31:29dom96(because the problem is that [] is ambiguous)
19:31:41FromGitter<Quelklef> That syntax feels misleading
19:31:47*couven92 joined #nim
19:32:04FromGitter<Quelklef> v:T looks like it says "v is of type T" so foo.blah:T looks like it says "foo.blah() is of type T"
19:32:05FromGitter<Quelklef> imo
19:32:27*fredrik92 quit (Ping timeout: 240 seconds)
19:32:50dom96oh no
19:32:54dom96FromGitter has a bug here
19:32:58FromGitter<tim-st> @dom96 should this work already?
19:33:11FromGitter<Quelklef> ? @dom96
19:33:13dom96it's missing the []
19:33:22FromGitter<tim-st> I tried with both
19:33:22dom96foo.blah\[:T\]
19:33:26FromGitter<tim-st> yes
19:33:29FromGitter<tim-st> didnt work
19:33:32dom96no, it's not implemented
19:33:38FromGitter<tim-st> ah, ok
19:34:04FromGitter<Quelklef> I see foo.blah[:T]
19:34:21FromGitter<Quelklef> Wait, I'm confused
19:34:22dom96Here is the relevant issue: https://github.com/nim-lang/Nim/issues/3502
19:34:31FromGitter<Quelklef> (also [:T] looks like a face)
19:35:24FromGitter<tim-st> ok, thanks for looking into it
19:37:15FromGitter<tim-st> Is it possible to return a default type for T? If object -> nil, value: 0 ?
19:37:35FromGitter<tim-st> maybe with ptr
19:37:36FromGitter<Quelklef> My vote goes for changing array subscript notation rather than generics notation
19:38:50dom96That's not gonna happen :)
19:39:51*couven92 quit (Read error: Connection reset by peer)
19:39:52FromGitter<Quelklef> Really? Seems like generics would be more important than array subscripting, so should take precedence. Is that wrong?
19:41:27dom96why would we change such a common operation's syntax?
19:41:38dom96when it's already using a syntax that is used by most languages?
19:41:56mirandom96: i'm looking in the example 3.1 - why `let x = newTable[:string, int]` doesn't have : before int?
19:42:21dom96oh, maybe I got it wrong
19:42:21FromGitter<Quelklef> Are generics not more common?
19:42:30dom96and it's actually just `:` at the start
19:43:01mirandom96: also, can these :foo be limited only for :T, and not used for int, string, char, etc.?
19:43:17dom96huh?
19:43:31FromGitter<Quelklef> @miran why break consistency?
19:43:31dom96it's for generics, there is no type specificity
19:44:01miranQuelklef: because it looks ugly? :D
19:44:18dom96Quelklef: maybe, but Nim's generic instantiation syntax is fairly unique
19:44:49dom96so it makes more sense to supplement it
19:44:51FromGitter<Quelklef> @miran I guess. Consistency > beauty in this situation imo
19:45:12FromGitter<Quelklef> @dom96 That's true. I personally really love the `[]` syntax so I guess i'd just hate to see it go
19:45:18mirani guess this might be a new strfmt :D :D
19:45:22dom96it won't go
19:45:27dom96Like I said, it'll be supplemented
19:45:43FromGitter<Quelklef> Won't it? From `[]` to `[:type]`
19:45:54dom96both will be supported
19:46:27*couven92 joined #nim
19:46:29PMunchHmm, now I have all the symbols defined in an enum and various sets of those enum values. Is it possible to define a type as any enum in a certain set?
19:46:29miranthen why introduce new stuff? the old one will be deprecated at some point?
19:46:30FromGitter<Quelklef> Ah. Seems dangerous to go that way, though
19:46:40miranor just to get rid of some bug(s)?
19:47:20*yglukhov joined #nim
19:48:49dom96I'm not sure. It's possible this won't happen at all
19:48:53dom96Araq and I discussed it a while back
19:49:34*BitPuffin is now known as webgl
19:49:44FromGitter<Quelklef> What'll happen to the current related issues, then?
19:50:07*webgl is now known as Muresan
19:50:19*Muresan is now known as Murii
19:52:04*yglukhov quit (Ping timeout: 256 seconds)
19:53:00*Murii is now known as Allah
19:53:14*Allah is now known as BitPuffin
19:56:07PMunchHmm, and how can I check if a string matches one of the enums in a set?
20:01:17PMunchWell okay, I can just write a simple contains method for my last question
20:01:36PMunchBut the first one, can I specify a type that is a subset of an enum?
20:04:19dom96no idea what you mean
20:05:22PMunchI have my enum with all the tokens in the language. I also have sets (built-in kind) of various sub-sets of this enum to distinguish them.
20:05:46PMunchIt would be neat if I could specify a type that could hold only one of the values in such a subset
20:06:03PMunchThis is what I have: http://ix.io/Etd
20:09:15dom96I'm still unsure, but what I would be doing is making an object variant out of that
20:09:32dom96btw IIRC setting a string value to an enum value like that isn't valid
20:10:47PMunchWhat do you mean isn't valid? It appears to work just fine
20:11:28PMunchThis is what the parser looks like so far: http://ix.io/Etg
20:19:02dom96I always end up just defining a `$` for the enum for one reason or another
20:19:34PMunchWell there seems to be one pre-defined
20:19:41FromGitter<tim-st> Can I check the type of an Generic Type Parameter?
20:19:49FromGitter<tim-st> K of string: ...
20:19:59PMunchIf I do "echo syntax" after the loop then it shows the string value and not the enum name
20:25:49*Yardanico_ quit (Remote host closed the connection)
20:39:19*user0 quit (Quit: user0)
20:46:29*MJCaley joined #nim
20:56:11*BitPuffin quit (Remote host closed the connection)
20:56:51*vlad1777d quit (Ping timeout: 246 seconds)
20:59:20*clyybber joined #nim
20:59:40*clyybber quit (Client Quit)
20:59:58*clyybber joined #nim
21:00:45*clyybber left #nim (#nim)
21:01:13*clyybber joined #nim
21:05:02*yglukhov joined #nim
21:11:56*miran quit (Quit: Konversation terminated!)
21:12:57*adeohluwa quit (Quit: Connection closed for inactivity)
21:17:18*billakos joined #nim
21:17:31*billakos quit (Client Quit)
21:19:54*chemist69 quit (Ping timeout: 256 seconds)
21:20:40*chemist69 joined #nim
21:25:02*Trustable quit (Remote host closed the connection)
21:28:21*yglukhov quit (Remote host closed the connection)
21:32:58*lamda_ joined #nim
21:33:50lamda_damn, well, both: Nim and Pony, aren't stable yet, so i will just learn fucking rust
21:33:59lamda_fucking rust
21:33:59PMunch:(
21:34:09PMunchlamda_, Nim is getting there :)
21:34:18lamda_okay cool
21:34:25*Cthalupa quit (Ping timeout: 268 seconds)
21:34:27*MJCaley quit (Quit: MJCaley)
21:34:31PMunchAnd it's actually fairly stable already
21:34:37lamda_i may change my mind about Nim when it get stable
21:34:42lamda_okay yeah
21:34:48PMunchBut there will probably be some larger changes now that we are coming up on 1.0
21:34:52lamda_i think it is more stable than Pony honestly
21:35:06PMunchJust to make sure that it doesn't have to be done after 1.0 :P
21:35:06lamda_like what?
21:35:13lamda_okay
21:35:30PMunchHmm, can't think of anything at the moment. But there has been talk about improving the standard library
21:35:39PMunchOr at least make it more coherent
21:35:45*Vladar quit (Remote host closed the connection)
21:36:03PMunchAraq is also working on some cool memory stuff but he says that will be for Nim 2.0
21:37:16lamda_Okay cool
21:38:31*Cthalupa joined #nim
21:40:41*xkapastel quit (Quit: Connection closed for inactivity)
21:41:21clyybberI think rust is not really comparable to nim, as the design goals are pretty different
21:41:23PMunchAnd by the way lamda_ Nim 1.0 is not that far away (I think)
21:41:46PMunchAraq mentioned something about the next version being RC1
21:42:59clyybberwhile nim strives for elegance as in maximise productivity per code, rust just throws its syntactic salt everywhere
21:43:22FromGitter<ZarsBranchkin> Nice, hadn't heard of that term yet
21:44:04lamda_yeah, rust isn't perfect, there isn't a perfect language :(
21:44:24lamda_humans aren't perfect :/
21:45:01lamda_i just wish these languages were stable now or asap
21:45:33FromGitter<ZarsBranchkin> Yeah, I suppose just like with everything else, everyone has to find their own language, that satisfies their needs
21:46:08clyybberYeah rust is actually pretty good at what its for
21:46:34clyybberand the little hickups dont matter that much in the grand scheme of a huge project
21:46:38clyybbersuch as firefox
21:47:10clyybberBut i must say Pony looks interesting
21:47:59lamda_yes but it is not stable yet :(
21:48:26lamda_https://github.com/ponylang/ponyc/issues
21:48:33dom96lamda_: Maybe instead of trolling you should help these projects?
21:49:04PMunchThat's a bit harsh isn't it dom96? :P
21:49:16lamda_i reported a bug yesterday, but idk if it is worth learning it now
21:49:41dom96PMunch: It's not: https://irclogs.nim-lang.org/21-01-2018.html#06:54:52
21:50:27PMunchOh, you think he's just trying to garner supporters for Pony?
21:50:37dom96No, read the full logs
21:51:50FromGitter<ZarsBranchkin> Oh, saw some of that guy yesterday. How is that troll related though?
21:51:58clyybberi thought to myself "wierd, seeing a new language(pony) mentioned twice on the same irc channel"
21:52:03dom96It's the same person
21:52:19clyybberprbbly
21:52:29FromGitter<ZarsBranchkin> Heh, makes sense since I hadn't heard of Pony before as well
21:52:43lamda_should i give up on pony until it is stable?
21:52:51PMunchI have actually heard of it before
21:53:01clyybber@lamda_ decide yourself
21:53:07lamda_how?
21:53:14FromGitter<SolitudeSF> just give up on programming and computers altogether
21:53:17PMunchlamda_, flip a coin?
21:53:28FromGitter<ZarsBranchkin> Could also help making it stable, as dom said. Besides while doing that, you'll be real proefficient at it by the time it's usable
21:53:43lamda_okay, also, i guess, i shouldn't give up, Rust has bugs too and it is stable
21:54:21clyybberaccept that most things have bugs
21:55:40lamda_okay :)
21:57:04clyybberAlso if you are just starting to learn programming you could try lua too
21:57:19clyybberand work your way up
21:57:34clyybberor down to more low level languages
21:57:44lamda_no, i use C since 2016, i just got tired of C
21:57:51clyybberoh well
21:58:11FromGitter<ZarsBranchkin> Heh, I started off with Lua and I found Nim to be so far the best combination of high level abstractions and low level functionality
21:58:35clyybberi srarted with lua too
21:58:46clyybberand can only agree with your statement
21:59:05lamda_i am tired of C, but i haven't decided which language to learn :/
21:59:18clyybberterra is also a very bery interesting language
21:59:36lamda_i heard of terra
21:59:39clyybbersomewhat hard to compile yourself but really cool
22:00:26clyybberHave ypu tried it?
22:00:29FromGitter<ZarsBranchkin> That's an interesting idea, combine Lua with low level language
22:00:41clyybberYep and it works pretty well too
22:00:42FromGitter<RayoGundead> would be nice if there was a lisp(or clojure) with borrow checker instead of GC
22:00:49lamda_no, i haven't try it
22:00:55clyybberGo ahead
22:01:08clyybberits pretty easy to install the binaries
22:01:38PMunchI wish Pixie would come back
22:01:42PMunchVery interesting language
22:03:14FromGitter<ZarsBranchkin> Ooh nice, lisp like language. Have had pretty fun experience with lisp. Mainly using emacs now, so I mess around with lisp from time to time
22:03:23clyybberIs pixie dead?
22:04:22PMunchclyybber, well they recently had some activity
22:04:29PMunchBut very little in the last year or two
22:04:45PMunchSo it might be edging back but haven't seen any activity in the IRC channel now for a few days
22:05:04clyybberHmm, it surprises me that it is fast written in python
22:05:35FromGitter<ZarsBranchkin> Yeah, found that bit odd as well. I'm not exactly familiar with RPython though
22:05:50FromGitter<data-man> Pony is a little horse? Why not a hippopotamus?
22:05:57PMunchWell, it is RPython and it uses a JIT to compile itself. The compiler is written in RPython so as soon as one iteration of a loop is compiled you can run it many times without much overhead
22:06:46PMunchPlus it's a functional language so fast is a bit relative
22:07:27clyybberi find it wierd that there are so many lisp dialects, why?
22:07:47dom96because it's easy to implement lisp dialects
22:08:01FromGitter<RayoGundead> and then there's gambit scheme
22:10:00lamda_lol read the story behind the name
22:12:49*adeohluwa joined #nim
22:13:38*endragor joined #nim
22:16:26lamda_what is everyone doing now?
22:17:04PMunchlamda_, I'm playing around with implementing Protobuf natively in Nim
22:17:52FromGitter<ZarsBranchkin> Sick with studying, thinking of returning to writing a small Nim post
22:18:16PMunchOoh, any interesting topic Zars?
22:18:30*endragor quit (Ping timeout: 260 seconds)
22:18:46PMunchErr, I mean "you should not stop studying, studying good, fun bad"
22:19:39FromGitter<ZarsBranchkin> Been a tough session, some break is alright, haha
22:20:33PMunchWhat're you studying?
22:20:36FromGitter<ZarsBranchkin> I stumbled upon post about the command `yes` and how it uses clever things to write to stdout reaaally quickly. Wanted to see if Nim can match it's speed to see how it stands up to native C
22:21:20FromGitter<ZarsBranchkin> Well in general, going for physics bachelor, but right now I have left differentialequations and mathematical analysis(I guess same as calculus) exams
22:22:22PMunchOh cool, got some friends studying physics
22:22:39PMunchPersonally I did computer science, just finished my masters degree
22:22:49FromGitter<data-man> I am reading the "Origin" (Dan Brown novel) :)
22:23:13dom96I'm watching BBC news because it's too late to really do anything substantial :)
22:23:19PMunchdata-man, is it good?
22:23:28FromGitter<ZarsBranchkin> Yeah, all this time I thought I'll go for computer science, but ended up going for physics to change things up. Probably will work as programmer though, but this knowledge will still be handy
22:23:34*lamda_ quit (Ping timeout: 260 seconds)
22:23:56FromGitter<data-man> @PMunch: Yes
22:23:59PMunchHmm, there was someone on here recently asking about using an iterator in a recursive way. Did he figure out how to do it?
22:24:54PMunchdata-man, I read Digital Fortress, The Da Vinci Code, Deception Point, and Angels & Demons
22:25:01FromGitter<tim-st> In the docs it's recommended to use stack instead, but many problems are difficult to write equivalent using a stack
22:25:18clyybberIm going to bed
22:25:28PMunchBut "The lost symbol" hadn't come out by the time I was done with the others so never got further
22:25:35PMunchNight clyybber
22:25:49clyybbergood night
22:25:58*clyybber left #nim (#nim)
22:26:02PMunchtim-st, where in the docs?
22:26:10dom96I'm reading Fire and Fury currently
22:26:37dom96PMunch: Why do you need that?
22:26:40PMunchHaha, that's gotta be a ride
22:26:59FromGitter<tim-st> @PMunch search for "preorder" here: https://nim-lang.org/docs/tut2.html
22:27:11PMunchI'm currently reading "The Time Machine" by H. G. Wells
22:27:25FromGitter<tim-st> but preorder is also an easy example, I had a very difficult one and gave up^^
22:27:28PMunchdom96, well messages in the protobuf format can be nested
22:27:43dom96PMunch: oh, that's a classic. I enjoyed it a lot.
22:27:45PMunchSo I wanted to run the "parseMessage" procedure again when I found a new message block
22:28:27FromGitter<tim-st> @PMunch maybe you could break to outer block and save the state in a var
22:28:33FromGitter<tim-st> I use this way for my parser
22:28:36dom96where does an iterator come into that?
22:28:46PMunchWell that's basically what a stack would be used for tim-st :P
22:28:56PMunchfor t in proto.tokenize({'{', '}', ';'})
22:29:02PMunchThat's where it comes in :)
22:29:12FromGitter<tim-st> But it's more difficult to implement it using a stack instead of using vars
22:29:37PMunchWell, I should probably rewrite this parser anyways to be more secure..
22:29:51PMunchParsers are sometimes such a pain in the ass to write..
22:30:34FromGitter<tim-st> especially for natural languages, yes
22:31:01PMunchOh yeah, this is a bit easier than that :P
22:31:27FromGitter<data-man> If you have not read "The Hyperion Cantos" by Dan Simmons, I highly recommend.
22:31:30PMunchBut since it's so rigid I kinda want to check for bugs as well. Which means a lot of extra checks
22:31:59dom96It seems like you should create some sort of Tokenizer object
22:32:11dom96Which offers a ``take`` procedure that yields the next token
22:32:15*nsf quit (Quit: WeeChat 2.0.1)
22:32:24PMunchHmm, that could work..
22:32:39PMunchOr I could just assume that the .prot file is not absurdly large and read the whole thing into memory
22:32:47PMunchJust give me a seq of some sort
22:32:52dom96yep
22:33:35*solitudesf quit (Ping timeout: 248 seconds)
22:33:38dom96when I needed to do something like this I just wrote my own lexer and parser
22:33:50dom96by using a while loop + index
22:33:56dom96https://github.com/dom96/nael/blob/master/src/lexer.nim#L10
22:34:31dom96Your parser might benefit from a Token object as well
22:36:32FromGitter<ZarsBranchkin> Recently started using token objects when parsing some text, pretty neat to work with them
22:36:47FromGitter<tim-st> in @dom96's code the technique could be used I said with breaking to outer scope instead of nested while true's it's described in the xmlparser section, where html is parsed using xml
22:37:12FromGitter<tim-st> at least there is a simple example
22:37:27PMunchI was thinking read the entire file into a string (which I already do). Then remove comments and newlines (tokens are otherwise separated anyways). Then split on ';' and strip whitespace from all ends. Then I can write parser procedures that take a seq and an index (to avoid copying), and have those recursively parse the tokens.
22:38:52dom96Well... that's a bit of a complicated way of going about it
22:39:47dom96You'd probably be better off generating tokens like {, }, ';', '//' etc. Then in your parser you can easily skip after a // token.
22:39:58dom96It's just more flexible this way
22:40:47dom96Also, there are many edge cases which pegs will be hard to get right on
22:41:01*c0ntribut0r quit (Ping timeout: 268 seconds)
22:41:05dom96I don't know if this applies to protobuf, but what if I write "// blah"?
22:41:21dom96Adding special cases to the peg will be a PITA
22:41:43PMunch proto.replacef(peg"'/*' @ '*/' / '//' @ \n / \n", "")
22:41:57PMunchThat's what I currently to. Removes comments and newlines
22:42:22*c0ntribut0r joined #nim
22:43:18*Ven`` joined #nim
22:43:47dom96I would strongly encourage you to have your parser handle these
22:44:02dom96it could even be useful to represent comments in your AST
22:44:09dom96someone might have a use for them
22:44:10PMunchWhy? That's a PITA
22:44:39PMunchHandling /**/ in the middle of pretty much everything, no thanks..
22:44:51FromGitter<tim-st> Btw what I didnt find in the docs is whether I can overload generic procs, e.g. first one all unless string, last one only string. does it work?
22:44:52dom96because replacing it with pegs is hackish and error prone
22:45:10FromGitter<ZarsBranchkin> Doesn't seem so, recognize comment while you're not parsing any other token, start a new token for comment. Sounds pretty clean to me
22:45:29PMunchWhat if I do "int /* was float */ variableName = 3;"
22:45:54PMunchdom96, well there are problems with it, sure
22:46:08dom96token: "int", commentStartToken: "/*", token: " was float ", commentEndToken: "*/"
22:46:08FromGitter<ZarsBranchkin> Well you check if you're not parsing any token first. Here you'd be inside a string token already
22:46:40PMunchHaving a */ in a string for example would terminate a comment early with my current peg
22:46:53dom96case tokens[i]: of commentStartToken: while tokens[i].kind != commentEndToken: inc(i)
22:47:10PMunchYeah, but that makes for unreadable parsers..
22:47:31dom96er.. how?
22:47:39dom96in what way is what you're doing more readable?
22:48:21FromGitter<tim-st> I think there are not really good readable parsers for complex languages. Jetbrains defines a static proc for every state and calls it in there IDEs
22:48:29PMunchBecause the entire body of the main proc ends up being a check that delegates parsing off to smaller chunks of specific parts of the language
22:48:46PMunchSo if you have a bug with one part of the parsing then you can go the the aptly named proc and fix it
22:49:03dom96that sounds like a description of the code I'm proposing
22:49:03PMunchAnd not some obscure "take" procedure that does everything
22:49:08PMunchHmm
22:49:30FromGitter<tim-st> Does anyone knows the answer to my question above^^
22:49:36dom96You don't have to have procedures to make things clear
22:49:55PMunchNo, but they help
22:50:04PMunchTake something in, spits something concrete out
22:50:06dom96This is how Araq taught me to write parsers btw
22:50:20PMunchThen it's just a matter of calling on the right proc at the right time
22:50:43PMunchWell it's probably the right way, I just don't like it :P
22:51:06dom96Well then you'll likely have a buggy parser
22:51:24PMunchMight've..
22:51:46PMunchWell, I've got to go hang up some clothes, then I'm probably off to bed. I'll think about it :)
22:52:26dom96Please do, and feel free to ping me if something isn't clear.
22:52:49FromGitter<ZarsBranchkin> @tim-st pretty sure I saw that case mentioned on manual. Not sure if I'll find it now, but from what I remember, concrete type proc defentition will take higher priority than generic one
22:53:21dom96tim-st: you should be able to. Why not give it a try?
22:53:31FromGitter<tim-st> Thanks for your answer, unfortuantely it didnt work. I got error "two matching procs"
22:53:45dom96Show us your code :)
22:54:13FromGitter<tim-st> I have to uncomment it and find it again
22:58:22*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:58:59FromGitter<ZarsBranchkin> Just tested out and it works fine for me: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a651b335ade18be39a5f545]
23:00:17FromGitter<tim-st> first one: `proc deserialize*T (self: LevelDbConn, key: string): T =`
23:00:34FromGitter<tim-st> second one: `proc deserialize*K, V (self: LevelDbConn, key: K): V =`
23:01:22dom96oprypin: ping, bug with FromGitter ^^
23:01:28FromGitter<tim-st> Error: type mismatch: got (LevelDbConn, int literal(1)) ⏎ but expected one of: ⏎ proc (self: LevelDbConn, key: string): string{.gcsafe, locks: 0.}
23:01:33*natrys quit (Quit: natrys)
23:02:19FromGitter<ZarsBranchkin> How can it resolve the first one
23:03:01FromGitter<ZarsBranchkin> Hm, haven't really looked into generic return types
23:03:32FromGitter<tim-st> the first one works using ``let x: someType = deserializesomeType (db, "key")`
23:03:53FromGitter<ZarsBranchkin> ah right, makes sense
23:04:46FromGitter<tim-st> I hope it's not again *return type overloading* which is not supported
23:04:52dom96https://play.nim-lang.org?gist=8972f312dc0293d1906fd343b1bc3aa4
23:04:54dom96Tried to reproduce
23:05:20dom96it could possibly be to do with return type overloading
23:05:57FromGitter<tim-st> I think it was my mistake I didnt declared using [K,V] but only [K]
23:06:02FromGitter<tim-st> Thanks!
23:10:42FromGitter<tim-st> perfect it works, thanks. I additionally had the Key declarations switched^^
23:33:10*marenz_ quit (Ping timeout: 260 seconds)
23:36:59*devdri joined #nim
23:48:53FromGitter<ZarsBranchkin> Hm, why does https://nim-lang.org/docs/lib.html page load so slowly every time I visit it?
23:49:29FromGitter<ZarsBranchkin> I suppose it has to do with fetching the unofficial packages, but could at least fetch the standard libraries first and load the unofficial ones in background
23:50:18FromGitter<ZarsBranchkin> I'm using firefox and the page seems to load some content and then hangs up for a bit
23:55:12PMunchHmm, looking into parsers maybe I'll end up writing something like Parslet in Nim instead of Protobuf :P