<< 20-05-2019 >>

00:21:17FromDiscord<treeform> I know a ton about float point. How do you want to manage it?
00:23:06FromDiscord<treeform> @Zevv, thanks! I can always turn recursion into iteration that is what it did... nim should have a better error message though.
00:46:14*a_b_m quit (Quit: Leaving)
00:48:06smitopWhy is there a link to a 3-year-old gist in the channel description by dom96... of a number?
00:48:39*cyberjpn joined #nim
00:49:59*krux02_ quit (Remote host closed the connection)
00:50:49smitopIt's called userrecord.txt, is it the max. ever users in this channel? We haven't broke our users in channel record since 2015?
00:52:41FromDiscord<DeltaPHC> Though not always appropriate, fixed-point math is an alternative to dealing with floating point inaccuracy
00:55:08FromDiscord<DeltaPHC> The basic idea being that you use the smallest denomination as your 'unit'. Like if you're counting money, you wouldn't use floating point because the inaccuracy would pile up very quickly. So instead, you might store it as an integer - the number of pennies
01:10:40*madpat quit (Quit: ERC (IRC client for Emacs 26.2))
01:32:33*cyberjpn quit (Ping timeout: 245 seconds)
01:49:05*rnrwashere quit (Remote host closed the connection)
01:52:09*rnrwashere joined #nim
02:01:36*banc quit (Quit: Bye)
02:01:51*rnrwashere quit (Remote host closed the connection)
02:04:11*rnrwashere joined #nim
02:08:25*rnrwashere quit (Remote host closed the connection)
02:10:40*rnrwashere joined #nim
02:14:24*rnrwashere quit (Remote host closed the connection)
02:14:52*rnrwashere joined #nim
02:22:35*banc joined #nim
02:35:11*shashlick_ joined #nim
02:35:23*shashlick quit (Read error: Connection reset by peer)
03:06:42*theelous3 quit (Ping timeout: 244 seconds)
03:16:20*smitop quit (Quit: Connection closed for inactivity)
03:18:55*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
03:21:29*Lord_Nightmare joined #nim
03:37:34*vlad1777d joined #nim
03:43:31*rnrwashere quit (Remote host closed the connection)
03:45:13*rnrwashere joined #nim
03:50:10*narimiran joined #nim
03:53:00*rnrwashere quit (Remote host closed the connection)
03:53:26*rnrwashere joined #nim
04:19:33*nsf joined #nim
04:54:58*dddddd quit (Remote host closed the connection)
04:58:09*JustASlacker joined #nim
05:17:55*leorize quit (Quit: WeeChat 2.3)
05:59:15*leorize joined #nim
06:01:10*rnrwashere quit (Remote host closed the connection)
06:17:21*shashlick_ quit (Ping timeout: 244 seconds)
06:25:35*solitudesf joined #nim
06:30:14*PMunch joined #nim
06:31:23*Trustable joined #nim
06:35:55*jjido joined #nim
06:47:46*surma quit (Read error: Connection reset by peer)
06:47:58*odc quit (Read error: Connection reset by peer)
06:47:58*LyndsySimon quit (Read error: Connection reset by peer)
06:48:04*surma joined #nim
06:48:09*deansher quit (Read error: Connection reset by peer)
06:48:11*LyndsySimon joined #nim
06:48:26*odc joined #nim
06:48:26*deansher joined #nim
06:49:01*vlad1777d quit (Ping timeout: 255 seconds)
06:51:23*banc quit (Ping timeout: 246 seconds)
06:55:22*banc joined #nim
06:57:32*solitudesf quit (Ping timeout: 252 seconds)
06:59:21*leorize_ joined #nim
06:59:38*leorize is now known as Guest92401
06:59:38*leorize_ is now known as leorize
06:59:53*Guest92401 quit (Ping timeout: 256 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:15*gmpreussner joined #nim
07:06:04*Zevv quit (Quit: leaving)
07:09:00*krux02 joined #nim
07:09:10*shashlick joined #nim
07:09:49*Zevv joined #nim
07:14:26*Zevv quit (Quit: leaving)
07:14:27FromGitter<mratsim> @j$ @DeltaPHC, use mpdecimal: https://github.com/status-im/nim-decimal
07:18:03*Zevv joined #nim
07:18:16skrylar[m]treeform: nim iterators are syntactic sugar for inlined while/for loops
07:20:43skrylar[m]although i haven't tried in a long while to see whether its any recursion or simple recursion. in freepascal where i've been doing stuff, the syntax sugar is for instantiating a nobject and doing a while next get current, so they do support looping (although iterators there are often classes which means alloc for each for loop, which is dumb since apparently it works just fine with object or records and drops overhead, but
07:20:44skrylar[m]w/e)
07:21:09*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:22:37ZevvI've just made a pr https://github.com/nim-lang/Nim/pull/11283 adds a better error message for recursive iterators
07:25:48PMunchHmm, this is cool https://nimble.directory/pkg/cascade
07:26:45*stevenfx joined #nim
07:28:47*leorize quit (Ping timeout: 256 seconds)
07:32:17*leorize_ joined #nim
07:36:17*stevenfx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:37:18*stevenfx joined #nim
07:39:13*stevenfx quit (Client Quit)
07:39:36*Zevv quit (Quit: leaving)
07:40:08*Zevv joined #nim
07:41:47PMunchHmm, trying to figure out how to identify people with an Active Directory instance. Anyone tried this before (in Nim or otherwise, not having much luck finding any way of doing this)?
07:43:14*stevenfx joined #nim
07:44:19*Trustable quit (Remote host closed the connection)
07:45:44*Trustable joined #nim
07:45:45*stevenfx quit (Client Quit)
07:47:28*gangstacat quit (Quit: Ĝis!)
07:48:49FromGitter<mratsim> The unique ID in active directory is called "SID"
07:50:30PMunchAh, I was more talking about how to actually perform a user/password log-in
07:50:32*Trustable quit (Remote host closed the connection)
07:51:00PMunchBasically we have AD at work, and I want to create a new service without needed to have everyone create new users
07:51:19PMunchs/needed/needing
07:51:36*Trustable joined #nim
07:53:09*Trustable quit (Remote host closed the connection)
07:54:00*Trustable joined #nim
07:58:18*Trustable quit (Remote host closed the connection)
07:59:12*Trustable joined #nim
08:02:59skrylar[m]cascades and with statements are quite nice
08:03:13skrylar[m]i wouldn't be surprised if we could have -> and ->> as macros too
08:04:29*leorize_ quit (Ping timeout: 256 seconds)
08:12:18PMunchskrylar[m], with statements?
08:12:49Zevvhttps://github.com/zevv/with
08:13:03FromGitter<mratsim> with is similar to Cascade, that's what you use in Excel
08:13:57ZevvI had some discussions with the cascade author wether we should merge 'with' and 'cascade', but for some reason we decided not to
08:18:10FromGitter<alehander42> livcd: https://www.youtube.com/watch?v=hlWCp210IIY&list=PLbFmgWm555yYuZdkZN6e7zoAoAfy-h6xQ&index=3 our talk got uploaded
08:18:41FromGitter<alehander42> it looks very rough, as a first talk in front of such an audience(at least for me), but what can you do
08:18:56FromGitter<alehander42> skrlarm[m] we've used `->` and `->>` iirc as macros in zero-functional
08:19:03FromGitter<alehander42> but as `.` alternatives
08:19:09narimiranZevv: your PR#11283 has one failing test (tests/iter/treciter.nim)
08:19:11FromGitter<alehander42> skrylar[m] *
08:19:16Zevvnarimiran: thanks
08:19:19FromGitter<alehander42> so it's possible syntactically
08:20:22FromGitter<alehander42> btw i tried newruntime with some simple examples several days ago
08:20:29FromGitter<alehander42> it seemed to work, cool
08:20:59FromGitter<alehander42> i noticed e.g. seq-s carry a context with an allocator Araq, is this possible to lead to overhead somehow
08:22:11*leorize_ joined #nim
08:22:23*Vladar joined #nim
08:22:24*floppydh joined #nim
08:30:59PMunchAah, that with. I like how cascade allows you to bind the result to a let assignment though
08:34:31*leorize_ quit (Ping timeout: 256 seconds)
08:34:32*rokups joined #nim
08:42:22Zevvnarimiran: test fixed, sorry for missing that
08:42:29narimiranZevv: np
08:45:11*rnrwashere joined #nim
08:45:48*Trustable quit (Remote host closed the connection)
08:46:40*livcd joined #nim
08:47:11*Trustable joined #nim
08:49:31*rnrwashere quit (Ping timeout: 248 seconds)
08:58:52*couven92 joined #nim
09:03:42PMunchalehander42, well some of your talks roughness is more technical than anything else
09:04:00PMunchWatching it right now :)
09:13:17FromGitter<jrfondren> `with` is fun, but as its own project it should have a splash image like "Inspired by a forbidden(TM) JavaScript feature!"
09:13:28ZevvPR
09:13:54couven92@jrfondren, well I think Python and C# had that first, didn't they?
09:14:33Zevvno clue. I don't even use it myself, I hacked it up for someone sometime
09:14:35FromGitter<jrfondren> maybe later today. I only about it from JS (as a dangerous thing) and from D
09:15:26FromGitter<jrfondren> in JS of course the problem is that if you get the (dynamic) fields wrong, you create a new variable in whatever the current scope is, which in JS is going to be wider than the `with`
09:16:30FromGitter<jrfondren> Python's `with` seems to be unrelated
09:18:28Zevvjrfondren: https://github.com/zevv/with/blob/master/README.md
09:18:44*NimBot joined #nim
09:18:50FromGitter<jrfondren> that WFM :)
09:19:25Zevvgood
09:21:20leorize[m]with is a pascal construct :p
09:24:47FromGitter<mratsim> Excel VBA had with first
09:25:24FromGitter<mratsim> oh maybe Pascal :p
09:26:23narimiranZevv: did you forget to push your PR fix? :)
09:29:09Zevveuh no? let me check
09:29:55FromGitter<alehander42> we had something like with Zevv, in the old py2nim
09:29:56Zevvoh right, I pushed. But I didn't commit first
09:30:03FromGitter<alehander42> but it was just a prototype i guess
09:30:16FromGitter<alehander42> a more nim-ish api would be cool
09:30:38FromGitter<alehander42> but i'd coordinate this with the new runtime
09:30:50FromGitter<alehander42> as it's quite centered around safely releasing resources/memory etc
09:30:56FromGitter<alehander42> which is the main benefit of with
09:32:00Zevvyeah, now its only sugar
09:32:31Zevvbut man was I proud, My First Macro
09:35:31FromGitter<alehander42> oh it's a great idea and not so easy , our macro was very basic meh
09:35:47FromGitter<alehander42> what was your second macro :P
09:35:51Zevvnpeg
09:36:03FromGitter<alehander42> @PMunch what do you mean, by technically rough :P
09:36:08FromGitter<alehander42> Zevv ah awesome
09:36:38FromGitter<alehander42> i never managed to do a good grammar dsl, finally i hacked something for one project but it was very uuhh
09:37:39FromGitter<alehander42> looks cool, is it possible to parse an actual small language with it?
09:37:47FromGitter<alehander42> what's the hardest thing you managed to parse with it
09:37:49Zevvdefinitaly
09:37:58PMunchalehander42, in the beginning there's some microphone cut outs and some jumping back and forth with the presentation
09:38:13Zevvdefinitely, it's hard to english
09:38:30leorize[m]Zevv: that's quite a leap from `with` :)
09:38:31FromGitter<jrfondren> I'm using npeg in production now, to verify that a s/// made all/only the desired changes to some modsec rules.
09:38:56FromGitter<alehander42> Zevv, nice i might use it for a shell language
09:38:58FromGitter<alehander42> small shell*
09:39:18*Mister_Magister quit (Quit: bye)
09:39:50Zevvgreat, let me know if I can help yout out, Npeg comes with one free example grammar for every user
09:40:11FromGitter<alehander42> @Pmunch oh probably, i didn't notice anything unusual tho
09:40:52FromGitter<alehander42> Zevv, haha great, i will mostly have something very simple, as shells excel in oneliners
09:41:08FromGitter<alehander42> which is not very simple actually !
09:41:16FromGitter<alehander42> but at least no indentation etc
09:41:43FromGitter<jrfondren> (it's only because of the verification step that I noticed that the ruleset includes redundant actions. modsec's dedication to maintenance traps AKA "user-friendly acceptance of mistakes" is truly inspiring)
09:41:44ZevvI don't believe a peg is suitable for that anyway
09:42:13Zevv"user-friendly acceptance of mistakes"?
09:42:34FromGitter<alehander42> Zevv: why
09:42:42FromGitter<alehander42> it's a normal language with subexpressions
09:43:08FromGitter<alehander42> e.g. [2] filter #%2
09:43:11ZevvI'd have to think that over, but it kind of feels alien
09:43:41FromGitter<mratsim> don't even try R then :P
09:43:42FromGitter<alehander42> [2] filter { cat %2 ~ regex }
09:43:50FromGitter<alehander42> my example was bad but yeah
09:43:50Zevvdepth of an indent is relative to the indent of the outer block, so you'd need to keep more context anyway
09:43:59FromGitter<alehander42> oh this is easy i think
09:44:02FromGitter<alehander42> i always make a simple prepass
09:44:12FromGitter<alehander42> where i replace indent and dedent keeping context
09:44:18FromGitter<alehander42> by <special indent token> etc
09:44:19Zevvof course, that changes things
09:44:24FromGitter<alehander42> and then match for this
09:44:31FromGitter<alehander42> but if you dont have multiline code
09:44:34*Mister_Magister joined #nim
09:44:35FromGitter<alehander42> it seems to be ok enough
09:44:39ZevvI still hate indent syntax, but hey, what can you do
09:45:00FromGitter<alehander42> m yeah, for the shell tho not sure for now mostly oneliners
09:45:18FromGitter<jrfondren> @Zevv, modsec rules have a list of actions that take effect for the rule. for user-friendliness(?), you can have redundant and contradictory actions--modsec will just take the last action as authoritative in such cases.
09:45:45leorize[m]Zevv: is there any example for composing npeg with lexbase?
09:45:50Zevvjrfondren: well, that is kind of sucky. And it silently ignores the rest?
09:46:12Zevvleorize[m]: nope. Araq keeps nagging about that, he thinks npeg is crap becauese of that (among other things)
09:46:28FromGitter<jrfondren> so if you want to remove "chain" from a list of actions, you have to watch out for a redundant chain that could still be in the list. or if you do a s/status:aaa/status:bbb/ as I did, you might only change the first of redundant status: actions, and the old second one is still the one used.
09:46:39FromGitter<jrfondren> yeah totally silently. my other use of npeg is a linter.
09:46:53FromGitter<jrfondren> same parsing code, different use.
09:46:57Zevvpart of the problem is that captures might refer to things in the past, so handling a stream is not trivial because you might need to access the data later on as long as there's an open capture
09:47:04FromGitter<alehander42> i dont really get why people likes lexers so much
09:47:19FromGitter<alehander42> @jrfondren oh linter for nim
09:47:22FromGitter<alehander42> ?
09:47:28FromGitter<jrfondren> linter for modsec rules
09:47:32FromGitter<alehander42> ah ok
09:47:50FromGitter<jrfondren> `nim check` is pretty good
09:47:57Zevvalehander42 I'm still a total nitwith about parser theory. I just implemented this thing because I personally like this way of doing it. Probably tons of reasons why its no good.
09:51:46FromGitter<alehander42> Me too
09:52:05FromGitter<alehander42> Just like to use less tools if possible
09:52:31FromGitter<alehander42> Of course lexers are good if you need just tokens
09:53:02FromGitter<alehander42> Maybe I have to take a look at lexvase
09:54:03Zevvit's probably not what you think it is
09:54:22Zevvit's only a tiny layer on top of streams to do the buffering for you
09:56:22FromGitter<alehander42> Mh maybe that's OK
10:04:26leorize[m]Zevv: can you do something like this with npeg? https://github.com/Araq/lexim/blob/master/ex1.nim
10:06:55Zevvsure.
10:06:58Zevvone moment
10:08:00Zevvbut there's not really a syntax there right, it's just tokens.
10:08:22leorize[m]yea
10:21:41*stefanos82 joined #nim
10:32:29PMunchalehander42, speaking of talks, I've been toying with the idea of a Nim room for FOSDEM next year. Or a small languages room, if we can't fill enough slots
10:33:56Zevvits good PR having a room
10:35:05PMunchMhm, part of the reason I want one :)
10:36:56PMunchIf last years call for participation is anything to go by it should be about 3 months until they are open for registrations
10:38:04*smitop joined #nim
10:39:34FromGitter<kaushalmodi> Zevv: `with` is heavily used in lisps
10:41:59FromGitter<jrfondren> that's the python with, not the pascal with.
10:48:23*lritter joined #nim
10:54:42Zevvleorize[m] sorry, lunch came up http://paste.ubuntu.com/p/jrWgtDzJBg/
10:57:10leorize[m]Zevv: nice! but can it integrate with a preexisting loop like that example?
10:57:41Zevvnope, not like that
10:59:40leorize[m]ok, let's hope that wouldn't be a problem
10:59:54ZevvI'd like to hear if and why you need that
11:00:38*couven92 quit (Read error: Connection reset by peer)
11:00:42Zevvthere is some state in the parser which is at this time not injected into the code blocks, but I could add that if required
11:01:17leorize[m]no idea yet :p I was writing a bash formatter in Nim, and have already got a lexbase-based structure
11:01:59leorize[m]was going to see if I could quickly integrate npeg to speed up the progress
11:11:36Araqlexbased structure ftw :-)
11:18:01skrylar[m]ew. parsing
11:35:53*Minimisthupper joined #nim
11:40:58*Minimisthupper quit (Remote host closed the connection)
11:48:21*dddddd joined #nim
11:51:27*Trustable quit (Remote host closed the connection)
11:57:36*xet7 joined #nim
12:04:51*metadave quit (Quit: Connection closed for inactivity)
12:26:22PMunchHmm, "choosenim update devel" still doesn't work
12:26:28PMunchAs in devel doesn't build atm
12:29:33ZevvAraq: I was wondering the other day, what's magic about 3*floatSize?
12:34:45AraqPMunch, what do you mean? travis is green
12:35:14AraqZevv, why do you ask?
12:36:01PMunchHmm, the new frontend for the playground needs devel (because of the file missing for Karax to work). So when I try to run "choosenim update devel" on the playground VPS I get a compilation error
12:36:50Araqno idea, try 'git clone && build.sh' etc
12:36:54ZevvI was explaining Nim to someone and making up examples on the go when I found out there is this magic minimal size considered by nim when deciding to pass things by copy or by reference, which I found out to be 3*floatSize
12:37:03*Snircle joined #nim
12:37:13Zevvwhich I found a bit hard to explain to this person :)
12:37:27Araqwell it's an optimization, Nim is free to do it the most efficient way
12:37:51Araqthere is nothing to explain here except that Nim's design is better than C++'s :P
12:38:10Zevvok, but where did the number come from? Is there some theoritical reason, did you get this number from experiments or did you throw a dice?
12:38:14Zevvjust wondering
12:38:33Araqdid some benchmarks
12:38:44Zevvmakes sense, thanks!
12:42:08livcdalehander42:zah: nice presentation !
12:44:39PMunchhttp://ix.io/1JyW/ < log from the failing choosenim update devel
12:58:25*PMunch quit (Remote host closed the connection)
13:00:34*PMunch joined #nim
13:10:21*poopBot joined #nim
13:14:23*neceve joined #nim
13:17:31poopBotis there matrix bridge to this irc too?
13:18:24livcdwhere i can find the list / pkgs that are being tested with every new release ?
13:19:31poopBotduno :) , can somone explain me why i cant do this ?
13:19:32poopBothttps://pasteboard.co/IfzMW6t.png
13:20:54Araqlivcd, https://github.com/nim-lang/Nim/blob/devel/testament/important_packages.nim
13:23:31livcdThank you
13:26:02poopBotso can somone explain me why 10 rows up i can foreach loop trough list and 10 rows down i cant?
13:26:18poopBotmeybe cuz i am in while loop or what
13:26:58ZevvpoopBot: in general for these questions, provide a minimal snippet that shows the behaviour so we can reproduce and help you
13:27:39poopBothmm its oop so its not really minimal, can give you whole
13:27:45Zevvbtw, did you find your out-of-range indexing problem yesterday? Was that you or was it the compile at fault? :)
13:30:37poopBothmm i found it i tihnk but issue was it was not at place where error code gived me, it put me error warning on line 145 or smeting and i head to echo "wtf1234" like 10 lines down to figure out where it really heppends
13:30:39poopBothttps://pastebin.com/eU7mN5Av
13:30:50poopBotdont lought too much :)
13:31:49poopBot#HERE IT COMPLAINS , my only logic is cuz is in while loop tought duno why would that block it will test on jdoodle to see if while loop blocks
13:32:04ZevvpoopBot: what nim version are you on?
13:32:27Zevvold stuff, right?
13:32:30ZevvI get 't.nim(248, 14) Error: undeclared field: 'category_name' for type t.PlayerSlot [declared in t.nim(22, 3)]
13:32:35Zevvwhich makes much more sense
13:32:39Zevvthen 'can not call .'
13:32:59poopBotbut there is category_name look 10 rows up i call same code
13:33:13poopBotline 232
13:33:50Zevvlook closer
13:34:16poopBotomg
13:34:27Zevv!eval "category_name" == "category_hand"
13:34:28NimBotCompile failed: in.nim(1, 17) Error: expression 'false' is of type 'bool' and has to be discarded
13:34:33Zevv!eval echo "category_name" == "category_hand"
13:34:35NimBotfalse
13:34:41Zevvwell, there you have it
13:35:33poopBotworst thing i was like meybe i mised some leater so i read like 10 times category letter by letter to be sure duno how i dident see hand/name lol
13:35:57Zevvget some sleep :)
13:38:32poopBoti would love if it was from sleep deprevation xD
13:38:42*ShalokShalom joined #nim
13:41:10ShalokShalomhow is the i just look one talk from 2016
13:41:23ShalokShalomhow much has the type inferrence improved since then?
13:41:40ShalokShalomdo I need typing
13:42:25narimiranShalokShalom: it improved 37%
13:42:53ShalokShalomthanks ^^
13:43:40FromGitter<jrfondren> Nim's type inference still isn't at OCaml levels. all of your bindings still need types, either expressly or with initialization
13:44:46ShalokShalomoh I see
13:45:02*solitudesf joined #nim
13:46:02FromGitter<jrfondren> what has improved is implicit initialization
13:46:45FromGitter<jrfondren> so you can say `var x: string` and then later `x.add "more string"` without worrying that `x` is nil
13:47:46ShalokShalomoh, I didnt even knew I woud have to worry xD
13:47:49ShalokShalomthanks a lot for that
13:49:09ShalokShalomcan I suggest inherent types? I see this as a viable way to reduce the clutter and get types correct in the same time. :)
13:49:58ShalokShalomsimply use an own type for every item, so undefined types get their own types, when I add an operator somewhere.
13:50:03FromGitter<kaushalmodi> ShalokShalom: Nim already does type inference, if that's what you meant
13:50:05ShalokShalomlike a dot at the end of the line
13:50:10ShalokShalomnope
13:50:19ShalokShalomI mean an improvement for that
13:50:27ShalokShalominherent types
13:51:11ShalokShalomsometimes, custom types provide more type safety since string and num can still collide
13:51:29ShalokShalomI never saw the benefit of such basic types.
13:51:40FromGitter<jrfondren> I don't know what that means. I'm happy with Nim's current type inference anyway. OCaml takes it to the point that I start having trouble reading my own code without editor assistance.
13:51:57*PMunch quit (Remote host closed the connection)
13:52:23ShalokShalomyeah, thats another issue
13:52:52FromGitter<jrfondren> the development focus right now seems to be on --newruntime, a practical alternative to having a GC.
13:52:56ShalokShalomI mean, that you get your own type on each new item when the operator gets applied
13:53:07ShalokShalomoh, nice :D
13:53:14ShalokShalomhow does that run?
13:53:23ShalokShalomlifetime?
13:53:38ShalokShalomand this development would require a few lines of code
13:53:40ShalokShalom10 minutes
13:54:01FromGitter<jrfondren> I haven't looked much into it. https://nim-lang.org/araq/destructors.html 's a blog about it.
13:54:08ShalokShalomthy
13:55:07FromGitter<jrfondren> and there are some wiki pages: https://github.com/nim-lang/Nim/wiki/NEP-2-Catching-up-with-Cpp--and-Rust:-Ownership,-destructors,-unique-pointers (really old), https://github.com/nim-lang/Nim/wiki/Destructors (newer)
13:55:20ShalokShalomthanks
13:55:28ShalokShalomwilll read that up
13:55:39ShalokShalomDo you know Pony?
13:56:12FromGitter<jrfondren> nope. I've heard they have Erlang-style concurrency with static proofs and no data races.
13:56:59ShalokShalomwell, the have a cooperative scheduler instead of the preemptive one in Erlang
13:57:26ShalokShalomso fault tolerance is out of the window
13:57:38ShalokShalomother than that, its awesome
14:01:08*ShalokShalom quit (Remote host closed the connection)
14:01:50poopBotnarimiran, and i think i know why you told me to look del up cuz when i del(0) it puts last element to first
14:02:19narimiranpoopBot: wooohooo, that't it :)
14:03:46poopBoti woudent noticed it if it was not ranking my hands wrong, tought i thinke i should did ranking from reverse of seq cuz perfomace wise
14:05:12narimiranthat's why i'm constantly telling you to read the manual and/or tutorials - you'll learn "the rules" much faster than by just experimenting and wondering why something doesn't work as you expect ;)
14:06:05FromGitter<jrfondren> although a quick test in inim helps. as long as you're not testing the times module :)
14:06:29poopBotbut this way i will remeber it better cuz i cryed for like an hour trying to figure out whats wrong
14:13:52*vlad1777d joined #nim
14:15:38Araqmratsim: https://github.com/nim-lang/Nim/issues/11269
14:17:17Araqwe use the right algorithm afaict
14:26:37*leorize joined #nim
14:28:52FromGitter<liquid600pgm> any way of making Nimble pass a task's arguments to the underlying `nim c`, like this? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ce2b9a4d22ba766a2cccb83]
14:29:23FromGitter<liquid600pgm> so that I can simply run `nimble run --my_arg:42` to run the compiled exec with argument `--my_arg:42`?
14:30:28shashlickthere's `nimble c` right?
14:31:01FromGitter<liquid600pgm> yes, but you still need to specify the file
14:31:07shashlickbut you'd have to still pass everything else
14:31:09shashlickya
14:32:54FromGitter<liquid600pgm> afaik I can use paramStr() and paramCount(), but it's not as convenient
14:35:17FromGitter<liquid600pgm> nope, that doesn't help
14:35:28FromGitter<liquid600pgm> I guess I'll have to define separate tasks for everything
14:44:53poopBottottaly offtopick but if anyone missed it https://www.youtube.com/watch?v=kE_byDwLjxk
14:44:56*theelous3 joined #nim
14:45:17*ShalokShalom joined #nim
14:45:54leorize[m]@liquid600pgm have you tried setCommand()?
14:46:15AraqShalokShalom, whenever I look at Pony I'm confused at iso/trn/etc
14:47:03Araqplus I don't like the actor model anyway :-)
14:54:21FromGitter<liquid600pgm> leorize: how would it help me with my issue?
14:54:49*drewr quit (Quit: ERC (IRC client for Emacs 26.2))
14:56:34leorize[m]it just change the current command, so flags might carry over
14:58:59FromGitter<liquid600pgm> nope, doesn't work
14:59:13FromGitter<liquid600pgm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ce2c0c1509b1035c77fa1aa]
15:00:11leorizeuse `switch()` to pass flags
15:00:19leorizelike `switch("run")`
15:00:32leorizeand pass your target file as the second parameter to setCommand
15:00:54leorize`--run` also works actually, just run them before setCommand
15:08:49narimiranmaybe related to PMunch's troubles with "choosenim update devel": https://forum.nim-lang.org/t/4866 ("curl ..... failed (twice) with a segfault.") (cc dom96)
15:09:24FromGitter<alehander42> @PMunch yes
15:09:27FromGitter<alehander42> you should try it
15:09:44FromGitter<alehander42> i'd love both: a small language room would be also interesting from purely lang design point of view
15:11:32FromGitter<alehander42> why is not pony using preemptive scheduling, it does sound more reasonable indeed
15:15:46poopBothttps://pasteboard.co/IfAy7p7.png its becoming :)
15:17:26poopBotnow just need to add round workflor raise fold call timers and networking :)
15:17:31Araqalehander42: have you seen that the inventor of the actors model doesn't understand 'goto' :P
15:22:37FromGitter<alehander42> i think i posted the youtube link that you commented that to :D
15:22:59FromGitter<alehander42> but i still dont remember the reason
15:23:05Araqyeah ... well, he doesn't understand 'goto'
15:23:24FromGitter<alehander42> btw e.g. afaik erlang/elixir dont implement the original actor model, theu just happened to work similarly
15:23:38Araqand acting all smug about Dijkstra not understanding goto, the irony
15:25:30Araqwho cares if Erlang implements the "original" actor model, it's underspecified
15:26:18FromGitter<alehander42> maybe, just saying that it's probably a bit like oop
15:26:30FromGitter<alehander42> many people with different ideas about what is it precisely
15:26:40FromGitter<alehander42> so that's not such a big deal
15:26:55Araqwell indeed it's like listening to Alan Kay about OOP.
15:27:16Araq"I noticed how you guys do OOP is terrible so it all was about the messages passing, trust me"
15:27:27FromGitter<jrfondren> Joe Armstrong confessed to having to sell Erlang as "having objects, really, if you think about it" back when OOP was big. Where processes are objects with internal state.
15:27:53Araqwho cares if Alan had C++ in mind when C++ was inspired by Simula, not Smalltalk
15:27:59FromGitter<alehander42> which reminds me, zah linked to me https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ several days ago, have you read it
15:28:19FromGitter<alehander42> well i think the idea is that
15:28:31FromGitter<alehander42> actor force you to encapsulate some things and behavior a bit better
15:28:31Araqyep, I read it, I agree with it
15:28:41FromGitter<alehander42> so maybe accidentally it's a better "oop" than some
15:28:57FromGitter<alehander42> but i overally don't like oop too much as well
15:29:46FromGitter<alehander42> yeah, probably one can say it was objective-c based on smalltalk
15:29:49FromGitter<alehander42> c++ more onsimular
15:31:07FromGitter<alehander42> but overally e.g. visibility seems to me like something that should be defined on modules level, not type ⏎ (even you could say that this way you can expose some internal state to some subsystems but not others)
15:32:04FromGitter<alehander42> etc , mostly its like most oop languages mix 10 different things which can be modelled as independent features better
15:34:22Zevvintersting writeup about the nurseries
15:34:56*skelett joined #nim
15:37:23*rnrwashere joined #nim
15:44:25*floppydh quit (Quit: WeeChat 2.4)
15:57:35*smitop quit (Quit: Connection closed for inactivity)
16:05:29FromDiscord<DeltaPHC> Sounds like 'scoped threads', which I do agree is a nice way to go about concurrency
16:09:36FromDiscord<DeltaPHC> Rust has a library for scoped threads, though I do wonder if the idea could be made better as a language construct
16:14:11*rokups quit (Quit: Connection closed for inactivity)
16:21:23*Trustable joined #nim
16:29:19*Jesin quit (Quit: Leaving)
16:51:34*Jesin joined #nim
17:04:01*JustASlacker quit (Ping timeout: 246 seconds)
17:15:34FromGitter<liquid600pgm> why does `-1 mod 64` return `-1`? shouldn't it return 63?
17:15:58FromGitter<liquid600pgm> according to the equation in the docs, this is what a graph of `x mod y` should look like https://www.desmos.com/calculator/9vhcbonogu
17:16:37FromGitter<liquid600pgm> but in reality, when `x` is negative, `y` is negative too which doesn't make sense
17:16:57Mister_Magistersorry for another stupid question but is there some sdl 2d game engine?
17:17:06FromGitter<liquid600pgm> yes, see nimgame
17:17:16Mister_Magisterthanks!
17:18:07narimiranMister_Magister: see the documentation/examples, it is quite nice: https://vladar4.github.io/nimgame2/
17:18:17Mister_Magisterthanks :)
17:18:37Mister_Magisterdoes it support touch?
17:24:14FromGitter<liquid600pgm> likely, don't know about multitouch
17:24:20FromGitter<liquid600pgm> you'll have to test it out yourself
17:24:30FromGitter<liquid600pgm> or find that in the documentation
17:24:51Mister_Magisterokay
17:24:59Mister_Magisteror just make PR :P
17:27:54FromDiscord<DeltaPHC> I think SDL2 (which nimgame is built upon) supports multitouch, so if it's not in nimgame, it's mostly a matter of hooking it up
17:28:50Mister_Magisterye i know that's what i ment through "or just make PR"
17:29:02Mister_Magistersdl supports it if nimgame doesn't then it will
17:33:05VladarI don't have any touch devices to test it on, so it isn't in nimgame2/input module yet (as well as sdl2's gamepads). PRs always welcome =)
17:34:10*jjido joined #nim
17:39:13Mister_MagisterVladar: leave it to me! I'm planning to maybe write my game i was planning to write in nim instead. It will be for SailfishOS only which is mobile OS :)
17:42:05FromGitter<alehander42> Araq, would the allocator become a part of the signature
17:42:44FromGitter<alehander42> e.g. being able to specify that something uses A allocator B allocator
17:45:05VladarMister_Magister: Awesome! I always said that the best way to improve an engine is to write a game on it. So far I din't have a chance to test https://github.com/Vladar4/sdl2_nim on something other than desktops as well, so you have a solid chance to unearth some nasty bugs there too =)
17:47:21Mister_MagisterVladar: in case of bugs ya will receive shitton of issues on github ;0
17:47:24Mister_Magister;)
17:48:26narimiranMister_Magister: please document along the way the making of your game, i'm sure there would be lots of interested people for that :)
17:48:39Mister_Magisterwhoa maybe
17:48:50Mister_Magisterit will take 2 years or so to make it tho
17:48:54Mister_Magisteri'm slow at those things
17:49:13narimirangreat, then we will have lots of blogposts by you :)
17:49:33VladarMister_Magister: issues < PRs ;-)
17:49:38Mister_Magisterxd
17:49:42Mister_Magisteralways
17:57:38Araqalehander42 that didn't work out so well for C++
17:57:47Araqbetter make it runtime polymorphic
17:58:18*rnrwashere quit (Remote host closed the connection)
18:02:17FromGitter<alehander42> yeah zah told me they had some issues with the std lib, but i never wrote much c++, so can't really appreciate it
18:04:51Araqwell imagine if your 'system.string' is incompatible with mine system.string and you will have a pretty good idea about its problems
18:06:12FromDiscord<alexander92> oh hello from discord
18:06:46FromDiscord<alexander92> yeah, but maybe it can be a different kind of type: where by default it doesnt take part in matching except if one excplicitly wants just a certain allocator
18:07:35poopBotMister_Magister, there are godot bindings too i think
18:07:40FromDiscord<alexander92> not very sure how often people use different allocators
18:12:25*rnrwashere joined #nim
18:13:43*rnrwashere quit (Remote host closed the connection)
18:28:41rayman22201@Araq, if you are still around, I have been (slowly) attempting to get Godbolt compiler support for Nim working. Where is the code for generating the mangled function names in C?
18:33:16Araqrayman22201, hey, it's in ccgtypes.nim
18:34:02rayman22201just found it. Ok. Thanks!
18:34:26Araqstrip away the _HASH part and there you go
18:34:49rayman22201That's what it looks like. I just wanted to make sure there wasn't anything more clever going on :-)
18:38:02*rnrwashere joined #nim
18:41:00FromDiscord<DeltaPHC> Is Nim always going to be a 'transpiler for C or C++', or are there long-term platforms for making an LLVM backend more first class?
18:41:16FromDiscord<DeltaPHC> *plans, not platforms
18:42:09FromDiscord<DeltaPHC> Or is it more that the backends will be on equal footing
18:44:41FromDiscord<DeltaPHC> I was only thinking about that because I was having the thought that Godbolt support would be neat, but the code it generates can typically only be as good as the C compiler used
18:47:56rayman22201There is a semi-official LLVM implementation of the compiler: https://github.com/arnetheduck/nlvm
18:48:37FromDiscord<DeltaPHC> Mm. I was mostly wondering if the 'preferred' default is going to change
18:49:25rayman22201There is a long answer to this, but atm, no.
18:50:10*ng0 joined #nim
18:50:16FromDiscord<DeltaPHC> Alright. I'm perfectly fine if just the choice is there
18:50:20rayman22201C/C++ compilers are pretty damn good these days, and actually provide a lot of advantages.
18:50:35FromGitter<jrfondren> woah, woah, let's not go that far
18:54:20rayman22201@jrfonden, you have to elaborate on that. idk what you mean. Nim is actually pretty well designed in this regard. It was doing the "backend / frontend" compiler split way before LLVM became popular. It's designed to allow for supporting new backends. It's not like anything is written in stone, but there are no plans to change the main implementation right now either.
18:56:01rayman22201I mean, Araq has been trying to make the default C++ instead of straight C for a while, and even that has gotten a lot of pushback lol.
18:56:45Araqthat's true but also the C++ target is now in very good shape
18:57:09Araqthe CIs covers bootstrapping with C++ and essentially all tests
18:58:04FromGitter<jrfondren> I just suggest that you defend Nim without praising C compiler writers. Those guys have been driven insane by undefined behavior.
18:58:40AraqI blame the C spec, it's insane
18:59:01FromDiscord<DeltaPHC> The C++ spec is even more insane, to be fair
18:59:06FromGitter<kinkinkijkin> c WAS specified in the early days of personal computing
18:59:30Araqthe compiler writers are usually down-to-earth, except for the GCC devs which are/were more like "read the spec, we are allowed to do this"
18:59:46rayman22201I have much respect for C compiler writers! lol. It's high praise that Nim uses those compilers as the default. :-P
19:00:41FromGitter<jrfondren> the three worries about transpilation are A) doesn't this mean I'll have to care overly much about the intermediate language? That I can't write Nim but must write Nim with C in mind? B) doesn't this mean Nim's performance can only be as good as frontend C performance with its lesser guarantees on aliasing, etc., and C) I'm sure there's a third one.
19:01:15leorizeA) no, C is just like ASM to Nim :p
19:01:22Araqare these real worries or something you think others think?
19:01:44*rnrwashere quit (Remote host closed the connection)
19:02:22FromGitter<jrfondren> and the answers are A) transpilation can be done poorly or well but Nim does it well so don't worry. B) C compilers can compile C-as-written-by-transpilers even better than C as written by C coders. C) I'm sure there's a thir done
19:02:36Araqlol
19:02:41*neceve quit (Read error: Connection reset by peer)
19:03:05Araq"Oh no, C can never faster than asm because it generates asm"
19:03:25Araq"oh no, C can never be safer than asm because it generates asm"
19:03:40Araq"oh no, C can never be more portable than asm because it generates asm"
19:03:48FromGitter<kinkinkijkin> touting that nim transpiles to C makes people think they have to keep in mind how C works in order to make good code, which isn't really true
19:03:56Araqpeople have strange ideas.
19:04:01FromGitter<kinkinkijkin> yeah
19:04:29leorizewhich is why Nim advertises as "compiles to C" instead IMO :p
19:04:39rayman22201Sorry. I don't trust anything. I'm going back to flipping bits with magnets by hand. /s
19:05:26FromGitter<kinkinkijkin> also, asm is inherently non-portable, considering it locks the programmer to the system setup it's being made on, and i've never heard anyone say C isn't as portable as asm
19:05:27narimiranrayman22201: <C-x> <M-c> <M-butterfly>
19:05:44*narimiran hopes that somebody will get the reference
19:06:11leorizexkcd!
19:06:24narimiranleorize: congrats, 10 points for you!
19:06:36*leorize pretends that they didn't lookup that one on the web
19:06:44narimiran:(
19:06:49AraqI still don't know what 'transpilation' is btw. my dict STILL doesn't have that word
19:07:12leorizemy spell checker doesn't know that word either
19:07:15FromGitter<jrfondren> people have strange ideas consistently, so have a reply handy. What's more, people are going to worry that they'll get advocacy rather than the truth. "Nim people say it's not a problem but I bet in practice it comes up all the time."
19:07:21rayman22201@narimiran https://xkcd.com/378/
19:07:57rayman22201;-)
19:07:58FromGitter<kinkinkijkin> turning code of one language to code of another automatically is how people define transpilation
19:08:15FromGitter<kinkinkijkin> except not when the language is asm
19:08:24leorizethat doesn't make sense :p
19:08:27Araqor Java bytecode.
19:08:39Araqpretty sure javac *compiles* to bytecode
19:09:29FromGitter<kinkinkijkin> java has so many ways to compile, and i don't like the word transpilation but all the hip kiddies nowadays are using it
19:09:31Araqof course, we all know that is not what Python does because Python is "interpreted"
19:09:54FromGitter<jrfondren> so I'd rather point to benefits. with Nim you can write a validation function and then run that on the frontend, in JS, and on the backend, in C or C++ or whatever. You get really good FFI. You can compile faster with tcc (maybe). You have infrastructure that lends itself to someone writing a Dalvik backend one day.
19:10:21Araqand C++ is only a "preprocessor".
19:11:32*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
19:12:03FromGitter<kinkinkijkin> the formation of natural language is weird, but challenging it doesn't do anything about it
19:12:09leorizenarimiran: was just messing with you :p that strip is why I didn't use emacs lol
19:12:17*laaron joined #nim
19:12:51FromGitter<kinkinkijkin> actually can form its own new weird items of natural lingual progress
19:13:28Araqkinkinkijkin: I do something about it, I tell people it's a term that makes one look like a noob, for good reasons. And in the end I'll win.
19:14:00AraqNobody uses 'preprocessor' for C++ anymore, there is hope.
19:14:19Araqin fact, many programmers do not even know what a "preprocessor" is.
19:19:42Araqjrfondren: we can update the website to be silent about it, Nim produces native code, that's all that's important
19:22:14FromGitter<jrfondren> you're going to hide the feature of it also compiling to JS?
19:23:07Araqno, but it's "native code on the server, JS code on the browser". maybe
19:25:28*lritter quit (Ping timeout: 245 seconds)
19:26:31FromGitter<jrfondren> I don't think it's that big of a deal, just that there are some reasonable worries (it's easy to imagine a Nim competitor that does things badly. It's very easy to get masses of C compiler errors from ATS for example, due to how it handles templates) and that they can be answered without committing the faux pas of praising C :)
19:29:25FromGitter<jrfondren> it's like GC. It's a frequent thing that people worry about and a lot of the worries might not be very well grounded but you may as well take it seriously.
19:30:41FromGitter<jrfondren> OCaml for example has a page that says "no! this is good! stop worrying about it!" https://ocaml.org/learn/tutorials/garbage_collection.html . That's at least a better response IMO that trying to deemphasize the GC
19:31:29Araqwait, ATS produces wrong C code?
19:31:53FromGitter<jrfondren> if you misuse templates it will
19:32:09FromGitter<kinkinkijkin> the grounding for gc fear was once well-grounded, reminder
19:32:22FromGitter<jrfondren> for example if you use hash tables in ATS, the stdlib assumes that your hash key will have a certain template defined for it, and if you don't do that you'll get a mass of mysterious compiler errors
19:34:10FromGitter<jrfondren> ATS's also the language I had in mind for producing C that C compilers optimize better than the C written by C programmers. bad video: https://www.youtube.com/watch?v=dsILVOqYCU0
19:35:27*ShalokShalom quit (Remote host closed the connection)
19:35:44*Trustable quit (Remote host closed the connection)
19:36:48FromGitter<jrfondren> well sure I'd rather be in Nim's position of having multiple alternative GCs + realistic gc:none with destructors, than just having to persuade the asker to learn to love GC
19:38:25Araqwise words
19:38:47AraqI dislike GCs for entirely different reasons than the rest of the world... :-)
19:40:34FromGitter<kinkinkijkin> bad GC collection timing is a thing, but in that case almost every language with GC that is still in development also has GC-protection and explicit GC calls available
19:42:02FromGitter<kinkinkijkin> in every case where it's harmful, you can just not use it, and so many people don't realize this, nor do anything that requires any sort of protection from GC
19:43:57*shashlick quit (Remote host closed the connection)
19:44:20FromDiscord<DeltaPHC> Nim only invokes the GC on memory allocation, right?
19:44:46*shashlick joined #nim
19:46:44FromDiscord<DeltaPHC> In such a case, it doesn't seem like it'd be too hard to avoid GC runs altogether if you make most of your allocations upfront. GC can't pause anything if it doesn't run :P
19:47:06leorizeor you can just set GC timeout to some really low value
19:48:24leorizeIIRC Araq once ran the GC with timeout of 10us
20:10:46*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:19:38*theelous3 quit (Ping timeout: 245 seconds)
20:22:49*narimiran quit (Ping timeout: 246 seconds)
20:24:59FromGitter<kinkinkijkin> alright, getting back to working on this project i haven't touched it half a year
20:25:05FromGitter<kinkinkijkin> in
20:29:30xacekinkinkijkin: are you referring to this? https://github.com/kinkinkijkin/kpmmlnim
20:29:50FromGitter<kinkinkijkin> yeah why ?
20:30:25xacejust got curious, looking for inspiration on what to do sort of...
20:30:31*disruptek quit (Ping timeout: 246 seconds)
20:31:24FromGitter<kinkinkijkin> the version on git is outdated, i have to fix that but i'm currently rereading this code
20:32:08xaceyeh, no stress, im reading the nim manual in lack of better things to do ...
20:34:02*disruptek joined #nim
20:35:19FromGitter<kinkinkijkin> also my code is a massive mess of forgetting what i was doing and having to redo it when i remember~
20:35:26FromGitter<kinkinkijkin> minus tilde
20:35:32FromGitter<kinkinkijkin> using two keyboards rn
20:36:07xacelol why? are you an emacs user or something?
20:36:15FromGitter<kinkinkijkin> no, two computers
20:40:12FromGitter<kinkinkijkin> one, my main desktop, is in windows and has this chat up; the other, my odroid-xu4, has vim open with a keyboard that's more comfortable
20:41:54xacehave you checked out synergy? 1 keyboard+mouse to rule them all?
20:46:00*nsf quit (Quit: WeeChat 2.4)
20:50:22FromGitter<kinkinkijkin> nah, don't need that kind of thing
20:51:25*jjido joined #nim
21:02:33*clyybber joined #nim
21:08:23*theelous3 joined #nim
21:08:43*xet7 quit (Ping timeout: 248 seconds)
21:10:31shashlickSynergy is a saving grace
21:11:22shashlickI finally got around to working on my python proxy which I was slacking off on because of Nim
21:12:46FromGitter<kinkinkijkin> oh apparently synergy even costs money
21:14:07FromGitter<kinkinkijkin> yeah i'd rather just put my spare keyboards and mice to use than pay 30 USD for multi-desktop integration software that might not even have a build for the type of processor in the computer it'd be useful with
21:15:49*laaron- joined #nim
21:16:40*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
21:16:43*Vladar quit (Remote host closed the connection)
21:20:43*krux02 quit (Remote host closed the connection)
21:21:41*xet7 joined #nim
21:24:43*theelous3 quit (Ping timeout: 255 seconds)
21:24:45*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
21:25:21*laaron joined #nim
21:29:13*laaron quit (Remote host closed the connection)
21:29:30*laaron joined #nim
21:29:31Araqhttps://www.cl.cam.ac.uk/~mr10/bcplman.pdf
21:30:04shashlick@kinkinkijkin - i'm using their last free version
21:30:18shashlick1.8.8
21:30:18Araqoh look, C got it all wrong, it used to be *n, not \n, these bastards clearly didn't respect established notations
21:32:51*laaron quit (Remote host closed the connection)
21:33:14*laaron joined #nim
21:40:07*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
21:40:34*laaron joined #nim
21:41:47*laaron quit (Remote host closed the connection)
21:42:07*laaron joined #nim
21:45:43*laaron quit (Remote host closed the connection)
21:46:13*laaron joined #nim
21:49:37*solitudesf quit (Ping timeout: 246 seconds)
21:53:37*rnrwashere joined #nim
21:53:44*laaron quit (Remote host closed the connection)
21:53:57xacekinkinkijkin there is also https://github.com/debauchee/barrier
21:54:25*laaron joined #nim
21:55:44xaceshashlick: I guess that link goes for you aswell ^^
21:56:12FromDiscord<kiwi> question: in python I can create an "array" of 0 to 100 with range(100). I can assign a variable with `a = list(range(100))`. What's the equivalent in nim?
21:59:02xaceisnt it array[100, int] ?
21:59:16FromGitter<jrfondren> that initializes the array to a hundred zeroes.
21:59:44xacewell you could also do a empty sequence with a set length/cap of 100
21:59:59FromDiscord<kiwi> yep. 😃 I was looking to create sequences without using lc say.
22:00:09xace!eval var a = newSeq[int](100)
22:00:10NimBot<no output>
22:00:12FromGitter<jrfondren> without using what?
22:01:14FromDiscord<kiwi> a listcomprehension
22:01:34FromGitter<jrfondren> ah. I don't see an obvious equivalent in stdlib, so I'd just write a loop.
22:02:10FromDiscord<kiwi> ok. I just thought i must be missing something obvious. thanks.
22:02:42FromGitter<jrfondren> it's a lot more important to do things the right way in Python, because the wrong way might be less efficient to a shocking or absurd degree. In Nim a simple loop's going to be as efficient as a built-in facility.
22:03:16FromDiscord<exelotl> I don't see a better way to do it than using a loop
22:04:22FromDiscord<exelotl> at least if there is one it's impossible to find because the nim docs in a lot of cases really hard to search if you don't already know what you're looking for :')
22:04:39FromDiscord<exelotl> I was thinking there might be like a map function for ranges
22:04:40jjidoAraq what is BCPL? The PDF is recent
22:05:06FromGitter<jrfondren> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ce324929d64e537bce2459a]
22:05:24FromDiscord<kiwi> yes, so was I exelotl. the similarities to python are huge so I tend to look for a mapping
22:06:17FromDiscord<exelotl> hmm, I'm generating some C code and I have a string containing raw binary data, which I want to embed in the output.
22:06:24FromDiscord<exelotl> In the Nim docs it says for addEscapedChar "This is not correct for producing Ansi C code!"... is there some function that *is* correct for producing ansi C code?
22:09:15FromDiscord<kiwi> Yes. I'd do it as an lc jrfondren so `var x = lc[ i | (i <- ..20), int ]`
22:09:42FromDiscord<kiwi> for a sequence of 20
22:09:56Araqlook at how the compiler does it, it's more tricky than you think
22:11:12FromDiscord<exelotl> dangit xD
22:11:34*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:12:55FromGitter<kinkinkijkin> oh dear, I've forgotten if nim lets you echo containers of containers in a formatted way
22:12:58*theelous3 joined #nim
22:14:31FromGitter<kinkinkijkin> i have a chunk of code that i need to inspect the results of, and if there's a standard function for it i'd prefer that over writing a small dumper
22:16:28FromGitter<jrfondren> you'll get the $ that you've defined, all the way down. in one library I have a -d: flag to skip those definitions, as the default stringification's better for debugging.
22:20:38FromDiscord<exelotl> oh is it just these two functions at the top I'm looking for?
22:20:42FromDiscord<exelotl> https://github.com/nim-lang/Nim/blob/61380d0a070a4a691e820e18b25e9dd8fb420306/compiler/msgs.nim
22:25:06clyybberkinkinkijkin: try repr
22:25:16clyybbergood night
22:25:19*clyybber quit (Quit: WeeChat 2.4)
22:28:13shashlickxace wish they had a chance log
22:29:06xaceyeah i stopped using multiple machines that way a couple of years ago so i cant speak for the experience. i rely fully on terminals/ssh these days... need to get a friendly browser for terminals... considering browsh
22:30:38xacebut judging from the readme its based on version 1.10 so its a slightly more recent compared to your 1.8.8
22:32:10skrylar[m]poopBot: there is
22:32:24skrylar[m][a matrix bridge to irc]
22:32:28*abm joined #nim
22:33:00poopBotduno myebe i install then nekho or soem other linux client for it
22:35:25*stefanos82 quit (Remote host closed the connection)
22:35:33skrylar[m]as for backends i dunno i always used the C one. not really a fan of C++. haxe uses c++ as its native code target and the build times are slow
22:37:05skrylar[m]@araq have you skimmed over the Be interface stuff at all? seems to be a pretty flat hierarchy, ought to be easy to replace subclass+hook with closures
22:38:31skrylar[m]might need to smuggle a few bits and pieces from vcl over to modernize it but. eh
22:41:50*rnrwashere quit (Remote host closed the connection)
22:42:53*ShalokShalom joined #nim
22:48:52*rnrwashere joined #nim
22:48:53shashlickWonder what's the benefit of barrier
22:50:36Araqnot aware of Be, sorry
22:51:04Araqbut as I said, personally I would go for immediate mode UIs
23:00:53*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
23:12:46*smitop joined #nim
23:18:24smitopIn this (badly titled) commit: https://github.com/nim-lang/Nim/commit/1c9b4e5d33ff6bca8f345951b72018171d47e251, Araq changed the licence. is there any documentation of all the contributors before that commit agreeing to that?
23:18:33smitopcan't find any
23:22:13smitopGPL -> MIT
23:23:01*rnrwashere quit ()
23:35:27FromGitter<jrfondren> https://github.com/nim-lang/Nim/graphs/contributors?from=2008-06-22&to=2013-05-15&type=c -- pretty small group.
23:39:19*abm quit (Quit: Leaving)
23:45:13*sz0 joined #nim