<< 25-04-2016 >>

00:29:53*space-wizard joined #nim
00:44:00*Motan quit (Quit: Page closed)
00:52:26*ephja joined #nim
01:10:50*Jesin joined #nim
01:21:55*yglukhov joined #nim
01:26:39*yglukhov quit (Ping timeout: 276 seconds)
01:28:13*zxtx quit (Ping timeout: 250 seconds)
01:32:25*zxtx joined #nim
01:53:56*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:19:52*Penagwin joined #nim
02:37:33*ephja quit (Ping timeout: 250 seconds)
02:41:01*zxtx quit (Ping timeout: 250 seconds)
02:41:06*zxtx_ joined #nim
02:41:30*zxtx_ is now known as zxtx
03:01:17*Penagwin quit (Read error: Connection reset by peer)
03:23:25*yglukhov joined #nim
03:27:36*yglukhov quit (Ping timeout: 244 seconds)
03:47:07*veganskaway is now known as vegansk
04:18:47*space-wizard joined #nim
04:32:39*apotheon quit (Ping timeout: 246 seconds)
04:58:07*Demos joined #nim
05:05:01*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:13:14*perturbation quit (Quit: Leaving)
05:24:58*yglukhov joined #nim
05:29:29*BlaXpirit quit (Ping timeout: 260 seconds)
05:29:56*yglukhov quit (Ping timeout: 276 seconds)
05:30:52*BlaXpirit joined #nim
05:32:22*endragor joined #nim
05:45:42*s4 joined #nim
05:54:20*Trustable joined #nim
05:56:13*space-wizard joined #nim
05:59:30*pigmej quit (Ping timeout: 244 seconds)
06:00:04*pigmej joined #nim
06:03:08*yglukhov joined #nim
06:07:37*yglukhov quit (Ping timeout: 260 seconds)
06:16:48*endragor_ joined #nim
06:20:51*endragor quit (Ping timeout: 268 seconds)
06:24:38*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:25:41*lokien left #nim ("Leaving")
06:41:09*endragor_ quit (Remote host closed the connection)
06:41:38*endragor joined #nim
06:43:50*BlaXpirit quit (Quit: Bye)
06:44:00*BlaXpirit joined #nim
06:52:32*yglukhov joined #nim
06:52:47*yglukhov quit (Read error: Connection reset by peer)
06:53:04*yglukhov joined #nim
06:53:55*yglukhov_ joined #nim
06:53:55*yglukhov quit (Read error: Connection reset by peer)
06:55:13*yglukhov joined #nim
06:55:13*yglukhov_ quit (Read error: Connection reset by peer)
06:55:14*rusua joined #nim
06:59:28*desophos quit (Read error: Connection reset by peer)
07:09:52*yglukhov_ joined #nim
07:10:09*yglukhov_ quit (Read error: Connection reset by peer)
07:10:09*yglukhov quit (Read error: Connection reset by peer)
07:10:23*yglukhov joined #nim
07:14:52*Arrrr joined #nim
07:27:24*yglukhov_ joined #nim
07:30:39*yglukhov quit (Ping timeout: 276 seconds)
08:06:22*yglukhov_ quit (Remote host closed the connection)
08:11:47*dorei joined #nim
08:16:04*yglukhov joined #nim
08:20:07*ephja joined #nim
08:20:14*StarBrilliant quit (Ping timeout: 276 seconds)
08:20:25*mtj_ quit (Ping timeout: 252 seconds)
08:24:09*yglukhov quit (Remote host closed the connection)
08:24:44*yglukhov joined #nim
08:33:41*StarBrilliant joined #nim
08:34:04*mtj_ joined #nim
08:54:41*StarBrilliant quit (Ping timeout: 276 seconds)
08:55:10*mtj_ quit (Ping timeout: 244 seconds)
08:57:45*StarBrilliant joined #nim
08:58:06*mtj_ joined #nim
08:58:20*Demon_Fox quit (Quit: Leaving)
09:04:31*fredrik92 joined #nim
09:08:12*yglukhov quit (Remote host closed the connection)
09:08:32kingofozproc myWriteln(f: File, a: varargs[string]) =
09:08:32kingofoz for s in items(a):
09:08:32kingofoz write(f, s)
09:08:32kingofoz write(f, "\n")
09:08:32kingofozvar f: File = open("a.txt", fmReadWrite)
09:08:33kingofozmyWriteln(f, "abc", "def", "xyz")
09:08:35kingofozecho(f.readLine())
09:08:37kingofozf.close()
09:08:45kingofozah, it is messed up
09:09:27kingofozI want to say this code can write but f.readLine() doesn't work
09:10:55Arrrrtry: '\n' -> '\l'
09:12:16kingofozcan not read either
09:14:49*gokr joined #nim
09:18:16ArrrrI tried flushing the file, but it gives me an exception. Probably you can't use files the way you want. Try with the streams module
09:18:23Arrrrhttp://nim-lang.org/docs/streams.html
09:20:18*yglukhov joined #nim
09:21:55s4kingofoz: try setFilePos() http://nim-lang.org/docs/system.html#setFilePos,File,int64
09:24:37*yglukhov quit (Ping timeout: 244 seconds)
09:27:29kingofozsetFilePos(f, 0) works
09:27:38kingofozthanks!
09:27:58kingofozI almost forgot position should be considered
09:31:07s4You're welcome
09:43:03*M-Quora quit (Ping timeout: 264 seconds)
09:43:39*M-max quit (Ping timeout: 264 seconds)
09:48:33*M-Quora joined #nim
09:48:39*vendethiel- joined #nim
09:49:09*M-max joined #nim
09:49:17*vendethiel quit (Ping timeout: 268 seconds)
10:00:58cheatfatedom96, https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L260 this is place where recursion starting with "immediate completion"
10:07:04dom96yeah, that comes from https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1262
10:07:36dom96I seriously think the solution is to just get rid of the stack trace
10:11:16cheatfatedom96, its not a solution you just hiding serious bug which prevent from using nim in production
10:12:51cheatfatedom96, i dont think Araq wants to make language just for experimental usage...
10:14:13dom96I guess you're right. Callback calls will always add more and more data onto the stack
10:15:18cheatfatedom96, not all callbacks but only when function returns finished future
10:19:06dom96okay, create a `proc callSoon(cb: proc ())` which queues `cb` to be called by the global dispatcher
10:19:17dom96then change all these fut.cb() calls to callSoon(fut.cb)
10:19:43dom96The name `callSoon` is up for debate.
10:21:12*novavis joined #nim
10:32:57*endragor quit (Read error: Connection reset by peer)
10:33:03*endragor_ joined #nim
10:58:53federico3Nim needs some reliable crypto primitives - second call for contributors to a libsodium wrapper github project - niv and me would be interested
11:02:19reactormonkfederico3, c2nim it?
11:03:04federico3reactormonk: not enough: https://github.com/judofyr/sodium.nim/blob/master/sodium.nim
11:03:35reactormonk:-(
11:03:35federico3and also, a wrapper to a crypto library should be tested, documented and reviewed a bit :)
11:04:04federico3ops, wrong paste: https://github.com/nim-lang/Nim/issues/3962
11:05:07nivhandcrafting the api is probably going to be prettier anyways, esp for some data types there might be reasonable cause to do wrappers
11:05:26federico3and safer to use
11:05:39nivyep!
11:08:45cheatfatefederico3, all crypto primitives in libsodium could not be reliable
11:09:20cheatfatefederico3, except AES-CGM i think
11:10:59federico3cheatfate: care to elaborate?
11:11:52cheatfatefederico3, i think openssl library consist of much more crypto primitives you want...
11:12:36cheatfatefederico3, or maybe you need to explain what is "crypto primitive" for you
11:13:30federico3cheatfate: this ones https://en.wikipedia.org/wiki/Cryptographic_primitive#Combining_cryptographic_primitives
11:14:47nivspeaking as a end-user, what nim stdlib is sorely lacking is hmacs, sha2 support, scrypt, and 25519 key stuff
11:15:08federico3openssl is way bigger than libsodium, by design - agreed.
11:16:44cheatfateniv, to support all kinds of public key cryptography you need something like BigInteger
11:17:20nivmaybe? but not to just sign, hmac, hash, or similar a arbitary byte sequence
11:17:25nivjust speaking practically here
11:17:41nivi think its something a modern stdlib should have, not being a optional package
11:17:53*fredrik92 quit (Quit: Leaving)
11:18:36cheatfateniv, sign is a public key cryptography too
11:19:34nivyes, obv. but you can hide that all in the backing lib like libsodium. that just takes pointers to binary data too
11:19:55nivor what are you suggesting you need bigints for on the nim side?
11:21:50cheatfateniv, i dont think you want "Hello World!" executable to be compiled with SHA algorithm inside
11:22:24federico3cheatfate: we are talking about a *wrapper* for libsodium, not implementing the algos in Nim :)
11:22:53cheatfatefederico3, i know you talking about wrapper, but niv talking about crypto primitives inside standart library :)
11:23:22nivoh, right. thats a different thing then, i guess. maybe a nimble module isnt so bad :)
11:23:29nivsorry for the confusio
11:23:30niv..n
11:23:54federico3niv: you meant putting the wrapper inside the standard library?
11:24:29nivwell in my dream world, yes, eventually, much like other languages ship with basic crypto stuff by default. it should be available to nim users at no additional dependency cost
11:24:39nivbut i realise now it might not be that straightforward
11:25:05nivand it might not align with nims design principles
11:25:18federico3Nim contains an openssl wrapper in the stdlib
11:25:41cheatfateniv, its not so hard to make crypto hash or simmetric crypto with nim
11:26:13cheatfateniv, you only need to take care about signed/unsigned integers
11:26:23federico3not hard but very bad for security
11:26:29nivi wouldnt really call the openssl api straightfoward
11:26:53nivand yes, reimplementing stuff thats already battletested isnt really a good first option
11:27:16federico3(otherwise we wouldn't be talking about libsodium :) )
11:27:26cheatfatefederico3, why do you think that one implementation is better then yours if you all producing equal test results?
11:28:30nivcrypto is much more than just passing a few tests. there's all kinds of issues to keep in mind. sidechannel attacks, timing attacks, random corner cases. bugs happen in the most insidious ways. plus, adding your own impl puts the weight on you, whereas with libsodium you get it from upstream
11:29:48federico3cheatfate: because 1) a well know implementation *might* be reviewed by a lot of people, mine is reviewed by noone 2) if there's a vuln in a famous library it might be announced very publicly and users/distros will update the wrapped library.
11:30:47cheatfatefederico3, the only man you can trust with 100% guarantee is you
11:31:07nivgetting crypto right is insanely hard and i wouldnt trust myself with it
11:31:46federico3cheatfate: for a lot of stuff I trust other people more than myself, e.g. I wouldn't attempt to do surgery on myself
11:32:42cheatfateniv, with such approach you will be always dependant on other libraries, but as i can see you can avoid this
11:32:44ephjawimp!
11:33:08nivcheatfate: depending on proven libraries isnt a bad thing when it's something as complex as crypto
11:33:20nivhandrolling your own crypto is the best way to fail hard
11:33:33federico3cheatfate: but here we are talking about writing stuff that other people will use. :)
11:33:35ephjait's more about the importance of the task in question, but yes
11:33:53cheatfateniv, i'm not talking about inventing crypto primiteves i'm talking about implementation of known algorithms
11:34:09ephjathere's nothing wrong with novel implementations that are unofficial though
11:34:55cheatfatefederico3, we are not talking about other professions we are talking about programming
11:37:58cheatfatefederico3, the only reason i'm talking about this - i dont trust Daniel J. Bernstein
11:38:00federico3same thing - you still want many pairs of expert eyes looking closely at your stuff :)
11:40:16cheatfatefederico3, you need expert eyes if you inventing new crypto algorithm... i dont think experts can take a look on crypto libraries from windows or macos... but everybody uses it...
11:41:46federico3ehm, actually implementation is often the weakest spot of crypto
11:45:21cheatfatefederico3, i dont think so... until your implementation can DEC(ENC(Y)) = Y on all limits of Y your implementation would correct, and i'm not talking about securezeromem and securezerocopy here
11:46:25federico3I'm afraid there's more. Side channel attacks, timing attacs, as niv mentioned
11:48:16cheatfatefederico3, side channel and timing attacks are suitable only for public key cryptography
11:49:07federico3huh? symmetric crypto can be vulnerable as well
11:51:50cheatfatefederico3, vulnerable to timing attacks and/or side-channel attacks?
11:51:54federico3yep
11:52:11cheatfatefederico3, i dont think you understand what are you talking about...
11:52:46cheatfateSymmetric ciphers have historically been susceptible to known-plaintext attacks, chosen-plaintext attacks, differential cryptanalysis and linear cryptanalysis.
11:52:55cheatfatehttps://en.wikipedia.org/wiki/Symmetric-key_algorithm
11:53:19federico3that's what I said
11:53:42cheatfatefederico3, and where you see this timing attacks and side-channel attacks?
11:54:32federico3look at the list of examples of side channel attacks:
11:54:38federico3https://en.wikipedia.org/wiki/Side-channel_attackh
11:54:41federico3https://en.wikipedia.org/wiki/Side-channel_attack
11:55:30federico3you can have power monitoring attacks in symmetrict crypto for example
11:56:11*yglukhov joined #nim
11:57:25federico3or not protecting a key in memory properly and so on
11:57:38*BitPuffin joined #nim
11:59:18cheatfatefederico3, you need to use terms properly "side channel attacks" are not used on primitives, they are used on protocols and primitives
11:59:33cheatfate*not primitives
12:00:09cheatfatewe are talking about implementation of crypto primitive, and not talking about implementation of key storage, or network protocol, or disk encryption
12:04:37federico3https://nacl.cr.yp.to/features.html
12:05:11federico3...under "No data-dependent array indices"
12:05:26federico3(this is just a random example)
12:08:56cheatfatefederico3, are dispute is useless just because you can't understand what i'm trying to say to you
12:09:27federico3ok
12:09:28cheatfateAES-CGM is not a crypto primitive
12:09:40cheatfateAES - crypto primitive
12:16:07cheatfatefederico3, its much easy to make reverse engineering on code which uses publicly available libraries, even if they bundled to your executable like static libraries
12:26:30cheatfatedom96, and how you want to implement this call_soon()?
12:27:03cheatfatedom96, because currently i have only one idea - make global Queue variable
12:27:30cheatfatedom96, to avoid all forward declaration problems
12:29:02*fredrik92 joined #nim
12:29:31dom96what forward declaration problems do you foresee?
12:29:52dom96just put a queue inside `Dispatcher`
12:29:58dom96and use the global dispatcher
12:33:12cheatfatedom96, i thought to replace only one place https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L260 to call_sonn(future.cb())
12:34:55dom96I think it makes sense to do in complete and fail too.
12:35:13dom96or maybe not
12:35:38cheatfatedom96, not need to patch in complete() and fail() just because when staff completed immediately future dont have callback yet
12:37:41cheatfatebut the problem is "callback=" dont know about dispatcher yet
12:38:36cheatfateor maybe futures must know Dispatcher...
12:46:17*fredrik92 quit (Quit: Shutting down . . .)
12:59:01*zama quit (Ping timeout: 250 seconds)
12:59:25*zama joined #nim
12:59:53*Jesin quit (Ping timeout: 250 seconds)
13:04:33*yglukhov quit (Ping timeout: 240 seconds)
13:11:50*Jesin joined #nim
13:31:18cheatfatedom96, any suggestions?
13:32:28*apotheon joined #nim
13:40:28cheatfatedom96, because i dont think its a good choice to make Queue global variable but any other choices are depends on you
13:46:32*gokr quit (Ping timeout: 276 seconds)
13:47:19dom96cheatfate: just forward declare `callSoon`
13:47:27*s4 quit (Quit: Konversation terminated!)
13:47:59cheatfatedom96, ok
14:09:31cheatfatedom96, ok i have encountered with 2 problems, one is easy but second one is tough
14:09:56cheatfatedom96, the tough one is "Non-2xx or 3xx responses: 2" when testing with wrk
14:13:56*saml joined #nim
14:30:46*GangstaCat quit (Quit: Leaving)
14:36:01cheatfatedom96, it looks like this patch reveal other bugs...
14:36:16*pregressive joined #nim
14:38:06*pregressive quit (Client Quit)
14:41:57*pregressive joined #nim
14:44:15cheatfatedom96, i need help with this warning [Warning: 'callback=' is not GC-safe as it calls 'call_soon' [GcUnsafe2]]
14:49:14*gokr joined #nim
15:06:46cheatfatedom96, please take a look https://gist.github.com/cheatfate/4e9dd1d870b89f6cb958897d399ac26c and my comment, i dont understand why this happend
15:08:03*rok joined #nim
15:16:46cheatfateAraq_, could you please take a look on https://gist.github.com/cheatfate/4e9dd1d870b89f6cb958897d399ac26c
15:19:34Araq_cheatfate: to the callback add .gcsafe, locks: 0 and see why the compiler thinks that is not the case
15:24:41*dorei quit (Quit: Page closed)
15:28:31cheatfateAraq_, i dont understand why this changes affect this callback setup
15:29:07Araq_it doesn't, it tells you more about the compiler error.
15:29:39*BlaXpirit quit (Quit: Bye)
15:30:51*BlaXpirit joined #nim
15:34:34*BlaXpirit quit (Client Quit)
15:34:54*BlaXpirit joined #nim
15:35:14*sorakun joined #nim
15:40:02*deavmi joined #nim
15:40:14deavmihow to concatenate strings in nim
15:40:25deavmior should i say concat say now an int to a string
15:41:22Araq_$i & "foo"
15:41:48deavmiwhere i is int
15:41:53deavmimade into a string uisng the $
15:41:55Araq_exactly
15:42:03deavmiand "foo" is concanetanted using conact operator &
15:42:03deavmi?
15:42:11deavmiThanks ;)
15:42:13Araq_yes
15:42:15deavmi* concat
15:42:23deavmiawesome, thanks ;)
15:42:31Araq_I often think about adding a & which can deal with ints and floats too
15:42:57Araq_but I dunno. often these things also weaken the type checking too much.
15:43:01deavmiOh lol.
15:43:21deavmiStarting to learn nim
15:43:25deavmiI like it so far
15:43:34deavmiEspecially when coming from pyhton
15:44:01deavmi* python and you get that syntax but some more stuff (where stuff="WOWOWOWOWOWOWOOWOWOW")
15:44:13Araq_it's addictive.
15:44:20deavmiIt is
15:44:28deavmiAraq_: Do you work on the project?
15:44:40Araq_I started it.
15:44:53deavmiThought so
15:45:07deavmiYou're a good guy for doing so.
15:45:30deavmiI don't have to struggle to find a modern high level language that compiles to low-level code
15:45:45deavmiI love watching the verbosity of the compilation, makes me smile.
15:46:13deavmiThe day a book comes out I will be getting it, but I must say the "Manual" is great
15:47:09deavmiIs there shorthand notation for `f = f + 1`
15:49:38ArrrrAraq, why did you chose '&' instead of '+' which takes less keystrokes
15:49:55Arrrrdeavmi you can use 'f += 1' or 'inc f'
15:50:02deavmiI see.
15:50:16deavmiArrrr: Does incr or inc use pointers?
15:50:42deavmiAraq_: is `stdin` a predfined File object or something like that?
15:51:26cheatfateAraq_, i just want to know why this changes inflict this error
15:51:38Araq_Arrrr: so that seqs of ints can have + for plus and & for concat
15:52:10Araq_cheatfate: and I just want to help you find it out on your own because I cannot take a closer look right now ;-)
15:52:51deavmif++ is not valid syntax in Nim. Could this be a feature in the future?
15:52:59deavmioh wait, you have inc (I forgot)
15:53:39ArrrrI agree with auto-string on concatenating
15:55:05deavmiWondering if my comments as descriptions are correct? - https://gist.github.com/deavmi/160ccf218ef07a9d7e997a0c91837842
15:55:26Araq_Arrrr: yeah but then why not have proc concat(x: varargs[`$`, string]) ? seems more idiomatic Nim these days.
15:56:49Araq_deavmi: spot on, but you can use name.add "d" instead of name = name & "d"
15:56:59ArrrrThe thing is, concatenating is used a lot, and you dont want to force the programmer to add boilerplate code that will hardly be absent
15:57:08deavmiso
15:57:21deavmiAraq_: Are strings an object?
15:57:38deavmiCause of the dot operation
15:58:52ArrrrYou can write your echoes like this: echo "its value is: ", i
15:59:23Araq_Arrrr: not sure concatenating should be used a lot though, usually things like 'echo' can be introduced
16:02:14ArrrrWell, speaking for myself, i concatenate a lot with non-string variables, in different contexts. Eventually everything comes to echo or writeFile, but these operations are performed before.
16:03:31ArrrrAnd in other languages, i'm used to a + b + " " + etc, and therefore the difference is notable
16:10:32cheatfateAraq_, it looks like some kind of compiler bug, because when i have modified this to use "type cbProc = proc()" and modified my functions this bug just disappeares
16:28:05*rok quit (Quit: rok)
16:28:25*krux02 joined #nim
16:30:42cheatfatedom96, it looks like you need to patch asyncdispatch.nim with queue by yourself, all my tries raising errors which i dont understand
16:32:00*space-wizard joined #nim
16:38:18dom96cheatfate: I can certainly try. Write a reminder for me on Github please (in the relevant issue).
16:42:39*elrood joined #nim
16:43:23*sorakun quit (Remote host closed the connection)
16:45:52*bozaloshtsh joined #nim
16:46:29cheatfatedom96, https://github.com/nim-lang/Nim/issues/3919
16:49:31deavmiAraq_: Is the type string an object a class of some sorts like I can do "dd".add("a")?
16:51:59ephjadeavmi: http://manual.nim-lang.org/docs/manual.html#procedures-method-call-syntax
16:52:28deavmiI see
16:52:32deavmiit's like an implicit parameter
16:52:38deavmi"d".add("d")
16:53:36*krux02 quit (Remote host closed the connection)
16:53:58deavmiI'm understanding OOP better now
16:54:30reactormonkdeavmi, nah, no implicit parameters. Just plain function calls.
16:55:10deavmiOh I see
16:55:16deavmiokay, let me get this straight then:
16:55:29deavmiIf I have the function (proc) len
16:55:44deavmiAnd I do: "Tristan".len()
16:55:53deavmiIt converst it to len("Tristan")
16:55:58reactormonkyeah, pretty much
16:56:07deavmiOh
16:56:16deavmithat's clever (I think I am understanding Nim now)
16:56:29reactormonkIt's just a way to teach OOP people about typeclasses
16:56:32deavmiso then... I'm going to write out some code and check this stuff out
16:57:11deavmiSo wait, you basically will create procs that are in no class but can operate on the data in a way?
16:58:37deavmiI see now
16:58:44deavmiI kinda see what is happening.
16:59:00deavmisomething.function
16:59:09deavmiwhere something will be placed as first arg in call to function?
16:59:55deavmiMy word: var d = 23 ; d.inc()
17:00:00deavmiThat worked, this is so cool.
17:00:22deavmibasically d.inc() or d.inc is translated into inc(d)
17:00:31ephjafoo.bar(x, y, z) -> bar(foo, x, y, z), foo.bar() -> bar(foo), foo.bar -> bar(foo)
17:00:37deavmiWOW! #DennisRitchieBeJealousForMe
17:00:45ephjathe latter of which can be used if the proc resembles a field (property)
17:00:53deavmilatter?
17:01:02deavmisorry, my advanced english is not so good
17:01:03ephjathe last of the three examples
17:02:29reactormonkdeavmi, special case are fields of an object, which can only be accessed via obj.field IIRC
17:02:37ArrrrThe trick even works for procs https://glot.io/snippets/ee3fhjhgrr
17:02:52deavmiI need to try something quickly
17:05:15deavmiI need to revise the type declaration syntax
17:05:43deavmiCause my word. I just can;t remmeber that.... damn idnentation (killing me - but makes code look nice)
17:06:04deavmiRootObj
17:06:33deavmiis that a type (built-in) that contains like stuff for doing stuff with types and stuff with objects and stuff
17:06:34deavmi?
17:09:55deavmiMust say glot.io is a nice site - thanks for sharing that.
17:10:08ArrrrNo, is just an alias for object http://nim-lang.org/docs/system.html#RootObj
17:11:58bozaloshtshRootObj is an alias for an object? It looks like a type from the error message from "echo RootObj"
17:11:58*brson joined #nim
17:12:38*PMunch joined #nim
17:13:31ArrrrYou are right, it is an alias for type object
17:16:43deavmiArrrr: And `object` is?
17:20:05bozaloshtshobject is object, a beefed-up tuple
17:20:06ArrrrIt lets you define types formed by several fields, for example https://glot.io/snippets/ee3fz3ohrm
17:20:31bozaloshtshbut if you want an object hierarchy you need a root, so RootObj serves that purpose. It's no different from a bare object.
17:23:17*darkf quit (Quit: Leaving)
17:34:26deavmibozaloshtsh: I see
17:34:53deavmidoes it add anything useful? RootObj
17:37:36deavmiSo yeah
17:37:36deavmihttps://glot.io/snippets/ee3fz3ohrm
17:37:43deavmiThis isn't working - https://glot.io/snippets/ee3fz3ohrm
17:38:22bozaloshtshRootObj does nothing
17:38:47bozaloshtshyour code doesn't work because echo implicitly calls `$` on its arguments
17:38:58bozaloshtshand since `$`(Person) isn't defined, you get an error
17:40:01deavmibozaloshtsh: I'm utterly lost.
17:40:03bozaloshtshhttps://glot.io/snippets/ee3fz3ohrm
17:40:17bozaloshtshhmm, not sure if that link will work
17:40:24*rusua quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:40:47bozaloshtshtrying to create a glot with working code to illustrate `$` procs
17:40:47deavminevrmind
17:40:51deavmigot it to work
17:40:51deavmihttps://glot.io/snippets/ee3fz3ohrm
17:41:06deavmihttps://glot.io/snippets/ee3fz3ohrm
17:42:15bozaloshtshhere try this: https://glot.io/snippets/ee3gl06xjz
17:47:11deavmireactormonk: This makes sense now - deavmi, special case are fields of an object, which can only be accessed via obj.field
17:47:46deavmireactormonk: Cause tbk.name makes sense, but name(tbk) just no. amkes no sense whatso ever
17:48:37deavmiHow can one do inheritance in Nim
17:48:52deavmihttps://glot.io/snippets/ee3gl06xjz
17:49:02bozaloshtshdeavmi: https://nim-by-example.github.io/oop/
17:49:03*sarlalian quit (Ping timeout: 264 seconds)
17:50:37*ludocode joined #nim
17:55:27*client_ joined #nim
17:55:30*sarlalian joined #nim
17:56:37*client_ quit (Client Quit)
17:57:39*kulelu88 joined #nim
18:02:08*deavmi quit (Ping timeout: 250 seconds)
18:08:46*kulelu88 quit (Quit: Leaving)
18:26:02*Ven joined #nim
18:30:04*krux02 joined #nim
18:38:41*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:02:14*pregressive quit (Remote host closed the connection)
19:03:23*pregressive joined #nim
19:12:41*rok joined #nim
19:15:10*BitPuffin quit (Remote host closed the connection)
19:19:03*fredrik92 joined #nim
19:26:41*Arrrr quit (Quit: WeeChat 1.4)
19:29:07*Gonzih quit (Ping timeout: 260 seconds)
19:31:31*castlelore quit (Quit: WeeChat 1.4)
19:44:17*castlelore joined #nim
19:59:10*krux02 quit (Ping timeout: 268 seconds)
20:00:06*krux02 joined #nim
20:22:21*enthus1ast joined #nim
20:24:52enthus1astdoes one know how to get some randomness at compiletime?
20:31:22ephjaenthus1ast: it might be possible with this library https://github.com/BlaXpirit/nim-random
20:32:34ephjabut it does use global variables
20:33:39krux02can't you read from /dev/random ?
20:33:44enthus1astnope
20:33:46*izi joined #nim
20:33:59def-krux02: sure, staticExec("head -c1 /dev/urandom")
20:35:20enthus1asti have to use an unfree system
20:37:06def-enthus1ast: compile a small nim program to output a random number with your favorite C bindings and execute it at compile-time with staticExec
20:37:26federico3enthus1ast: what are you doing with randomness at compile time? :D
20:37:36enthus1astmagiccc : )
20:37:50*desophos joined #nim
20:38:21enthus1astdef-: i think i would go with that
20:38:24ephjamaybe create a simple interface using some crude algorithm in the meantime, if the globals in nim-random can't be avoided
20:39:06krux02assume I am a Jedi: you do not want randomnes at compile time
20:40:26ephjaand who wanted to generate thousands of proc? I wonder what the use cases are
20:43:47enthus1astim playing with anti debug as you might thought
20:44:09enthus1astmainly im trying to reverse my own code
20:44:26enthus1astand it would be more fun with compile time randomness
20:44:31ephjawell, the opengl lib does, but the macro transforms the input (proc declarations)
20:44:55ephjaok
20:45:34ephjait's good to see a lot of metaprogramming experimentation
20:48:33*krux02 quit (Ping timeout: 240 seconds)
20:48:55*krux02 joined #nim
20:51:22*zahary quit (Ping timeout: 260 seconds)
20:58:49*yglukhov joined #nim
21:03:09*yglukhov quit (Ping timeout: 244 seconds)
21:07:07*Varriount_ quit (Ping timeout: 252 seconds)
21:09:29*Varriount joined #nim
21:14:14*elrood quit (Remote host closed the connection)
21:14:22cheatfateAraq_, is it possible with macro to access other modules which are imported and modify it?
21:19:05reactormonkcheatfate, nope, macros can produce code, not modify it.
21:19:44Araq_cheatfate: no.
21:20:12cheatfatethanks,
21:21:13cheatfatereactormonk, but asyncdispatch modifies code with {.async.} macro...
21:23:29*krux02 quit (Ping timeout: 276 seconds)
21:23:33reactormonkcheatfate, yup, but only local code.
21:23:55*krux02 joined #nim
21:24:27cheatfatereactormonk, i think not only local code but all code where {.async.} macro used and asyncdispatch imported...
21:27:01cheatfatereactormonk, but anyway thanks for answer
21:28:01*Trustable quit (Remote host closed the connection)
21:36:04ephjano, the async macro modifies symbols that it's applied to
21:39:25ephjaproc foo() {.bar.} = echo "test"
21:39:50*Varriount quit (Disconnected by services)
21:39:50*Varriount_ joined #nim
21:40:29*yglukhov joined #nim
21:43:05ephjathe AST of the proc now gets passed to the 'bar' macro, which can parse and modify it in any way, really
21:45:30*rok quit (Quit: rok)
21:51:14ephjaso 'async' in "proc p(): Future[int] {.async.} = ..." modifies 'p' only
21:52:29cheatfateephja, yeah
21:53:14ephjatake a look at the source code for the async macro and the asyncSingleProc proc if you want
21:59:51ephja"is it possible with macro to access other modules" not the ASTs, but a macro can depend on symbols defined in other modules, just like any other construct can
22:00:11ephjajust in case you were confused when they simply answered "no"
22:02:13ephjathere's no way to get the set of all enumerators, regardless of whether or not there are holes, right?
22:02:19*Varriount joined #nim
22:02:34ephjagetType to the rescue yet again? Sweet getType
22:03:21*sarlalian quit (Ping timeout: 246 seconds)
22:03:46*Varriount_ quit (Ping timeout: 252 seconds)
22:04:47*sarlalian joined #nim
22:07:41*Varriount_ joined #nim
22:07:41*Varriount quit (Disconnected by services)
22:08:09*jonafato quit (Ping timeout: 276 seconds)
22:09:32*jonafato joined #nim
22:12:22*Varriount_ quit (Ping timeout: 250 seconds)
22:14:10*Varriount joined #nim
22:14:49*ephja quit (Quit: WeeChat 1.4)
22:24:36*endragor joined #nim
22:26:28*novavis quit (Ping timeout: 250 seconds)
22:28:34*endragor_ quit (Ping timeout: 260 seconds)
22:28:55*endragor quit (Ping timeout: 244 seconds)
22:42:28*ephja joined #nim
22:44:35*Demon_Fox joined #nim
23:00:16*pregressive quit (Remote host closed the connection)
23:00:49*pregressive joined #nim
23:05:24*pregressive quit (Ping timeout: 268 seconds)
23:07:57federico3"foo.nim" =~ peg(".*?nim") why is this not matching?
23:10:08Demon_FoxIt looks like your using regex
23:10:30Demon_FoxIn which case, try this: "^.*num$"
23:11:17federico3I'm using pegs not regexes
23:17:13Demon_Foxok
23:17:26Demon_Foxregex is similar and might be worth a go
23:17:43Demon_FoxI haven't regretted learning it
23:18:28federico3the re module? it's deprecated
23:19:32Demon_FoxWhy is that?
23:19:50Demon_FoxI'm looking up peg, maybe it's a superset of regex
23:19:54federico3no idea
23:20:03*yglukhov quit ()
23:26:55federico3it doesn't seem to support non-greedy matching :(
23:31:33*allan0 quit (Ping timeout: 240 seconds)
23:39:00ephjafederico3: https://github.com/flaviut/nre.git
23:39:06*allan0 joined #nim
23:57:47*arnetheduck quit (Ping timeout: 244 seconds)
23:58:18*ephja quit (Ping timeout: 244 seconds)