<< 20-05-2015 >>

00:02:03*gsingh93_ quit (Ping timeout: 276 seconds)
00:02:13ZZZZZZZZZyou::can::go::play::with::rust::if::you::want::cool::namespacing.unwrap
00:02:18ZZZZZZZZZnothx
00:02:21dom96lol
00:04:30ZZZZZZZZZjava could be a good choice too: if (5 com.nim-lang.www.prelude.int.operators.+ 7 == 12) ...
00:05:14ZZZZZZZZZi really dont see why we need more namespacing, we can already do: from x import y
00:06:05ZZZZZZZZZand since its not a class language, it only imports what you ask to import, cant just pull everything that could act on the type
00:07:53ZZZZZZZZZis there any play on a standard typesafe interface for DB? the general one is stringly typed
00:07:53ZZZZZZZZZplan*
00:08:14*gokr quit (Remote host closed the connection)
00:09:14ldleworkI think the thing I like least about Nim is that it is classless.
00:09:21ZZZZZZZZZLOl
00:09:26ZZZZZZZZZits the thing i like most
00:09:30ldleworkAlright.
00:09:34ZZZZZZZZZstructs + functions
00:09:54ldleworkYeah sounds nice.
00:10:00ZZZZZZZZZand sometimes inheritance for dynamic dispatch is fun
00:10:34ZZZZZZZZZbut working with insane inheritance for everything is a pain in the ass, i work with that all day and its not fun
00:10:36ldleworkIf only it didn't create problems.
00:10:54vbtt_I like classless too
00:10:56ldleworkI'll take no-inheritance classes. :)
00:11:14ZZZZZZZZZi specially like that you can just extend the types everywhere
00:11:17VarriountZZZZZZZZZ: FactoryBuilderFactory extends MetaFactory
00:11:24ZZZZZZZZZpretty much
00:11:35ZZZZZZZZZi work a lot with PHP + magento
00:11:37ZZZZZZZZZomg
00:11:40ZZZZZZZZZwhat a fucking pain
00:11:42ldleworkVarriount: I know, this is how every single one of my Python games ends up
00:11:48ldleworkWith a FactoryBuilderFactory
00:11:48VarriountZZZZZZZZZ: My condolances
00:11:51ZZZZZZZZZ20 inherit deep
00:12:09ZZZZZZZZZtakes 20 minutes to setup the inherit to be able to override something simple omg
00:12:16ldleworkIts like, I can't even type the word class the first time in my editor unless its followed by FactoryBuilderFactory
00:12:25ZZZZZZZZZ30 min later you just.. fuck it ill just patch the core and be done with it
00:12:39ldleworkI'm glad we don't make our criticisms based on ad reductio absurdium
00:12:54VarriountZZZZZZZZZ: Have fun with the '==' operator?
00:12:59ZZZZZZZZZ=== ftw
00:13:14ZZZZZZZZZbut tbh i like php
00:13:33ldleworkat least it has classes
00:13:35ZZZZZZZZZbut i mostly just work with associative array instead of classes most of the times
00:13:36ZZZZZZZZZlol
00:13:52ldleworks/classes/methods
00:13:58ZZZZZZZZZsince its gonna die on runtime anyway, why waste your time with classes
00:14:41ZZZZZZZZZi just wish there was named tuples like in python, that way you can get easy 'typed' structs
00:17:32def-ZZZZZZZZZ: what are we missing about named tuples?
00:18:22ZZZZZZZZZeasy way to declare 'struct like' objects
00:18:24Varriountdef-: I think he means PHP
00:18:27ZZZZZZZZZin php
00:18:32def-oh, ok
00:18:32ZZZZZZZZZnot in nim
00:18:48def-I didn't read most of the discussion and assumed we're talking about Nim
00:18:49ZZZZZZZZZin php you always have to create a damn class etc.. in python, just name a type and bingo
00:19:14ZZZZZZZZZnah im satisfied with nim, it just needs dependant types :)
00:21:06dom96Dependent types? What for?
00:24:32VarriountWhat exactly are dependant types?
00:25:31VarriountAnd are they related to Nim's concepts?
00:25:36ZZZZZZZZZhttps://www.youtube.com/watch?v=fVBck2Zngjo
00:25:38ZZZZZZZZZno
00:26:00ZZZZZZZZZdependant types are types that depends on value
00:26:29ZZZZZZZZZwe can emulate some of it with macros in nim
00:26:49def-yep, for example a typesafe printf: http://nim-lang.org/docs/manual.html#special-types-typedesc
00:26:55ZZZZZZZZZexactly
00:27:46vikatonand to think I thought Ruby was flexibler
00:27:48ZZZZZZZZZits just more coherant, but more restrictive i guess
00:27:52vikatonflexible*
00:28:02ZZZZZZZZZlol
00:28:27ZZZZZZZZZruby is all runtime T_T, whats fun with idris etc is the type safety, same with nim
00:28:56vikatonyeah, thats why I went to an alternative
00:29:16ZZZZZZZZZyou can do anything in php too, its just not typesafe, so everything breaks a week later in prod, or when you refactor something
00:29:30*johnsoft quit (Ping timeout: 272 seconds)
00:29:46ZZZZZZZZZonce you taste to haskell for refactoring.... you just want to punch your screen when you work with something else
00:30:00*johnsoft joined #nim
00:30:32ZZZZZZZZZand by looking at idris, it looks like it makes everything even simpler, like their effects system are built in, not bolted on like states etc
00:31:26ZZZZZZZZZbut nim is a good middle ground i find, easy to wrap C code, etc
00:31:35ZZZZZZZZZlow level + high level
00:32:24*bjz joined #nim
00:32:26ZZZZZZZZZi still like to go full retard with php: http://pastebin.com/LapEYT4j
00:34:41*gsingh93_ joined #nim
00:35:15vikatonlol
00:36:12ZZZZZZZZZidris even compiles to php LOL
00:36:39*Senketsu joined #nim
00:37:00vikatonwhy is this red? https://github.com/Araq/Nim/blob/master/lib/pure/math.nim#L110
00:37:23def-vikaton: bad syntax highlighting, it thinks ' denotes the start of a character literal, like 'a'
00:37:36vikatonah
00:38:21vikatondoes Nim have embedded Nim? like erb?
00:38:25def-Would probably be useful to fix it in pygments (which github uses)
00:38:47ZZZZZZZZZits server side probably
00:38:50ZZZZZZZZZnever used it
00:39:06def-vikaton: http://nim-lang.org/docs/filters.html
00:39:59def-And blaxpirit reimplemented something similar: https://github.com/BlaXpirit/nimception
00:40:21ZZZZZZZZZi touched a bit to filters while experimenting on the forums to add 'new posts' information etc
00:40:50ZZZZZZZZZall i remember is i didnt get much compile time nor runtime errors if i had mistyped a variable T_T
00:41:53def-ZZZZZZZZZ: i just tried and i do get nice compile errors
00:42:14vikatonso, it only generates?
00:42:24def-vikaton: i don't understand
00:42:29vikatonyou cant filter another external file?
00:43:19vikatonhmmm
00:43:36*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:44:29def-Source Code Filters are supposed to be external files
00:45:39vikatonok so I have a file with "<title> $t </title>" in it
00:45:59vikatonwhat would be the Nim code to replace $t with Hello
00:48:34vikatondef- ?
00:48:56Varriountimport strutils; "<title> $t </title>" % ["Hello"]
00:49:12def-Looks like you have to wrap it in a proc indeed with source code filters
00:49:29def-Yeah, if you jut want templates it's easy: https://github.com/onionhammer/nim-templates
00:49:48*taesoo_ joined #nim
00:50:33VarriountSince Araq isn't here... anyone know why implicit conversion of a regular procedure to a closure/procvar is limited to the module the procedure implementation is in?
00:50:44taesoo_stupid question, how can I convert/cast a float to an int?
00:50:54*yglukhov_ joined #nim
00:51:01def-taesoo_: int(2.3)
00:52:28def-Varriount: https://github.com/Araq/Nim/issues/2172
00:52:29taesoo_nice! could you also explain 'cast[int](float)' if don't mind?
00:52:41*gsingh93_ quit (Ping timeout: 265 seconds)
00:52:49taesoo_(how to interpret cast operation?)
00:53:02def-taesoo_: cast just reinterprets the bits as the int type, that's totally unsafe
00:53:16def-type conversions, like int(2.3) are type-safe
00:53:55Varriountdef-: How does procvar restrict aliasing?
00:54:25VarriountI thought it was just a pragma marking that the procedure can be used in a variable.
00:54:31ZZZZZZZZZthere the toInt(f: float): int function
00:54:32taesoo_nice. I see cast in rust is a bit-to-bit conversion. thanks!
00:54:51ZZZZZZZZZor round in math
00:55:09def-Varriount: all i know is that code would break when you suddenly add a new parameter with a default value to a proc
00:55:15*yglukhov_ quit (Ping timeout: 250 seconds)
00:55:19vikatondef-, doesnt seem to work on external files
00:55:21ZZZZZZZZZi dont know the difference between int(float) and toInt(float)
00:55:30def-Varriount: which is a common way to extend a proc without breaking backwards-compatibility
00:56:20vikatonIs there an IRC bot framework layin around?
00:56:23Varriountdef-: But couldn't you just introduce auto-wrapper generation?
00:56:25vikaton:P
00:56:28Varriountvikaton: irc module
00:56:31def-ZZZZZZZZZ: toInt throws an exception when the value is Inf (infinite), int doesn't
00:56:38ZZZZZZZZZok
00:56:39def-Varriount: yes, that's what would be perfect
00:56:41vikatono ?
00:57:17ZZZZZZZZZdoes int(float) just tries to call the converter ?
00:57:26ZZZZZZZZZi guess
00:57:26vikatonright
00:58:01vikatonany docs on it?
00:58:22def-vikaton: I guess that's how you're supposed to use it: https://gist.github.com/def-/a3c4dd03b07aef6fe43c
00:59:04Varriountvikaton: https://github.com/nim-lang/irc/blob/master/src/irc.nim
00:59:12vikatondef- still no idea on external files?
00:59:17vikatonI have some pretty large html files
00:59:21vikatonthanks Varriount
00:59:39def-vikaton: you would just have to add a header like in foo.tmpl to them
01:00:09ZZZZZZZZZyou can look at nimforums for plenty of examples
01:00:22ZZZZZZZZZits uses them a lot
01:01:49ZZZZZZZZZthe biggest pain point with using them in sublime text, is the lack of syntax highlight, since its all a big comment + string
01:02:08*saml_ joined #nim
01:03:10def-ZZZZZZZZZ: need to add syntax highlighting for them. literate programming has similar problems
01:04:28VarriountZZZZZZZZZ: If you're using sublime text, are you using the NimLime Plugin?
01:04:31*xificurC_ joined #nim
01:04:32ZZZZZZZZZI hope visual studio code gains traction, it looks like a nice replacement to sublime text. I just cant wait til the plugin system works
01:04:37*Kingsquee joined #nim
01:04:49ZZZZZZZZZVarriount: i think so
01:04:57ZZZZZZZZZthere was 2 plugin i think, 1 outdated
01:05:01ZZZZZZZZZand 1 working
01:05:31ZZZZZZZZZVarriount: yes i just checked Nimplime
01:05:34ZZZZZZZZZnimlime*
01:05:35VarriountZZZZZZZZZ: If you want, you could help me test the next version of the plugin.
01:06:12*pregressive joined #nim
01:06:32ZZZZZZZZZVarriount: o lol its your plugin :D nice
01:07:17*xificurC quit (Ping timeout: 256 seconds)
01:07:27ZZZZZZZZZi only use the syntax highlight part of it, i just use the shell for everything else
01:07:55ZZZZZZZZZbut yes ill try to update to the latest version and report anything i find
01:08:13VarriountZZZZZZZZZ: Uh, the latest version isn't 'released' as of yet.
01:08:40VarriountIt's the latest version in the repository, however it hasn't been released on Package Control
01:09:27ZZZZZZZZZsure, but its probably not rocket science to install it with git :D
01:09:39ZZZZZZZZZi might do that this weekend
01:09:56VarriountThanks.
01:11:17*bjz joined #nim
01:14:36taesoo_def-: then I expected to have string(int) implemented? (I know $ operator from the tutorial though)
01:26:41*drewsrem quit (Quit: Leaving)
01:27:09*vikaton quit ()
01:27:22*taesoo_ quit (Ping timeout: 244 seconds)
01:31:05*jbomo joined #nim
01:33:26*darkf joined #nim
01:33:38*darkf quit (Changing host)
01:33:38*darkf joined #nim
01:35:41ZZZZZZZZZhttp://qr.ae/fU2Ti
01:35:51ZZZZZZZZZ./facepalm
01:37:13*Pisuke quit (Read error: Connection reset by peer)
01:38:56ZZZZZZZZZi like rust a lot, ive been using it since 0.6, but so much 'durr not safe this not safe that' everywhere since its being promoted like crazy
01:41:22flaviuLets stay civil, no matter how irritating certain people may be.
01:42:33ZZZZZZZZZthats how i like my programming language: https://www.youtube.com/watch?v=QNgc5_1wOFM&t=143
01:46:28dom96I wonder who this Captain McRetard is.
01:47:42*vikaton joined #nim
01:47:48vikatonhow can I type without a new line?
01:49:13*Senketsu quit (Ping timeout: 256 seconds)
01:49:46dom96vikaton: what do you mean?
01:50:14vikatonlike in Ruby, puts always ends with \n
01:50:26vikatonbut print doesnt end in \n
01:50:47vikatonis there a way in Nim to print with ending in \n ?
01:51:03notfowlvikaton, stdout.write()
01:51:17vikatonthanks
01:54:03*Senketsu joined #nim
01:54:08vikatonstr() casts to string right?
01:55:42notfowl$
02:11:23filwitjust reading logs, FWIW, I think people are complaining about a problem that doesn't exist in practice with the 'import foo' being "unclean" and needing a better 'from foo import nil' option. "Jump to definition" is a much more practical solution to the "where's this symbol from" problem than enforcing module prefixes on every imported type/proc you use. I think even if we had a better 'from a import b' solution people would inevitably
02:11:24filwitjust use the regular 'import a' solution eventually.
02:15:00ZZZZZZZZZplus you can already prefix everything if you want anyway
02:15:31ZZZZZZZZZand if theres a conflict you have to prefix it, so i dont see the problem
02:15:46filwitexactly
02:15:53ZZZZZZZZZits just not enforced, and as someone mentioned before, you can use a linter
02:16:17ZZZZZZZZZuse it in your build system and it will just like if it were in your compiler
02:16:21filwitand i especially don't like the idea of adding a whole new 'use module' syntax (even though I like the syntax in general, it's a very bad and confusing thing to add a whole different system like that)
02:16:49ZZZZZZZZZi just dont see any benefits to it either
02:17:00filwitanyways, just my 2 cents on the topic
02:18:08ZZZZZZZZZ(its the same for the constructors, its fine as it is ;) (with the eventual new pragma for 'private construct') )
02:19:33filwitwell i disagree with that, actually.. i think they can be improved without having really breaking backwards compat or increasing complexity too much. My arguments in this gist: https://gist.github.com/PhilipWitte/0ca58b9655a6f3fd8ff0
02:21:00filwiti think `TypeName()` is the most direct syntax to construct and object, so we should run with it and expand it a little to be more practical for complex types and types which want to enforce specific pathways to instantiation
02:21:45notfowlvikaton, the $ operator, $1 == "1"
02:22:21ZZZZZZZZZi disagree, hide the type constructor, and a named constructor if you you need runtime checks
02:22:29ZZZZZZZZZadd*
02:24:18filwityou disagree on what ground? I made my reasoning clear: TypeName() is the most direct syntax.. what is your counter to that?
02:25:09ZZZZZZZZZyou will have to override it and it will become a mess imo
02:25:12filwitalso, not sure exactly what solution you're proposing, but it's been proposed to limited T() syntax outside the type's module.. which is actually far more backwards incompat
02:25:22ZZZZZZZZZJsonStream(x: file)
02:25:28ZZZZZZZZZJsonStream(x: url)
02:25:30ZZZZZZZZZetc etc
02:25:45ZZZZZZZZZJsonStream(x: url, maxlenght)
02:25:46ZZZZZZZZZetc etc
02:25:57filwitno, that's exactly where you want named constructors: JsonStream.load() vs JsonStream(), etc
02:26:07ZZZZZZZZZthats what im saying
02:26:22filwitbut the *majority* of the time you just want a single (or few) ways to make a type
02:26:41ZZZZZZZZZyes and its already there
02:27:07ZZZZZZZZZall we need is a pragma to hide the type constructor
02:27:14filwitno, because it's too easy to create an invalid object (eg, an object which needs to be properly constructed or allocated specially)
02:27:26ZZZZZZZZZyes, thats why you have to create the right types
02:27:36filwitand there's no way to prevent people from using T() when they should be using your 'initT()' instead
02:27:43ZZZZZZZZZthere is
02:27:46ZZZZZZZZZthere will be*
02:27:54ZZZZZZZZZa pragma to hide the type constructor
02:28:00filwiti understand
02:28:07filwitit's still not as good a solution as mine
02:28:23ZZZZZZZZZyou will end up with 20 overloaded constructor
02:28:31ZZZZZZZZZplus yours can raise exceptions
02:28:31ZZZZZZZZZetc
02:28:39filwiti make the standard syntax better because there's no reason not too.. preventing the standard syntax is artificially limiting
02:28:54filwitexceptions aren't a problem
02:29:00ZZZZZZZZZits runtime
02:29:18filwiti'm not sure what you mean by "it's runtime"
02:29:23ZZZZZZZZZ...
02:29:48ZZZZZZZZZwith your new constructors, your T(x: string) or whatever can raise an exception at runtime
02:29:49filwiti don't understand what point your trying to make with saying something is runtime? exceptions?
02:30:14filwitokay.. but how is that any different than a 'initT(x:string)' ?
02:30:15ZZZZZZZZZor do whatever it wants
02:30:43ZZZZZZZZZit doesnt not replace the standard type constructor
02:30:49filwitso?
02:31:16filwitthat's a bad thing.. having a universal syntax everyone can expect to use for any type everywhere throughout the code is a good thing for learning curve
02:31:55ZZZZZZZZZits already standard imo
02:31:59ZZZZZZZZZnewT
02:32:00ZZZZZZZZZinitT
02:32:04filwitplus, it means you can first try to make a type with T() and get compiler errors about not providing the correct params and suggestions about which params to use (vs now where everything just gets caught at runtime)
02:32:07ZZZZZZZZZinit -> stack new -> heap
02:32:34ZZZZZZZZZwith the pragma it will tell you, you cant use it.
02:33:02filwiti understand it's "idiomatic" that way (even thought the stdlibs are still inconsistent on that).. but again, T() is the most direct and obvious syntax, period
02:33:29filwitit doesn't make sense *not* to make T() useful
02:33:37ZZZZZZZZZyes to allocate memory
02:33:42ZZZZZZZZZnot to check params etc
02:33:55filwitno, often types want to be cached or something
02:34:14filwitso often you definitely don't want objects to use T()
02:34:25filwitso we add the {.noConstructor.} pragma
02:34:43ZZZZZZZZZyes
02:34:46filwitand things give you errors, but they still can't tell you want to use 'initT', 'newT', etc
02:35:12*endragor joined #nim
02:35:20filwitplus, we now have a syntax T() which is good for somethings, but completely useless for others.. even though it's the most obvious syntax choice
02:35:34ZZZZZZZZZit would be even more confusing with T() vs named etc if they all do the same
02:35:41*gsingh93_ joined #nim
02:35:57filwiti don't follow, all do the same thing?
02:36:03ZZZZZZZZZno
02:36:15ZZZZZZZZZnamed can do runtime checks
02:36:16filwiti was asking what you meant by "all do the same thing"
02:36:18ZZZZZZZZZT() cant
02:36:29filwityes T() can do runtime checks...
02:36:34ZZZZZZZZZwith your proposal they would tbe the same
02:36:40ZZZZZZZZZright now they cant
02:36:45ZZZZZZZZZits a different thing
02:37:07filwitno no, right now they just *dont* execute anything beyond "allocate in this standard way"
02:37:13ZZZZZZZZZthats it
02:37:22ZZZZZZZZZconstant between all types
02:37:34ZZZZZZZZZno need to read anything or know anything specific to your type
02:37:39filwitso instead "allocate in the standard way + call your ctor" is barely different and not confusing at all
02:38:06filwitespecially if everything in Nim worked like that
02:38:42filwitit's like Nim's "useful defaults" on everything else.. if you don't provide a 'create' your get a useful default T().. if you want to customize that, use 'create'
02:39:00filwit1 syntax for everything (most of the time)
02:39:25vikatonyeah thanks
02:39:30ZZZZZZZZZi just dont see why its needed
02:39:52ZZZZZZZZZi prefer how it is right now, treat every proc the same
02:39:56*endragor quit (Remote host closed the connection)
02:40:09ZZZZZZZZZthere is no 'self' either...
02:40:15filwit*except destroy, and other special funcs*
02:40:38ZZZZZZZZZdestroy is : new(T, finalizer)
02:40:42ZZZZZZZZZits not special
02:40:49ZZZZZZZZZits per instance
02:41:11filwitmy system addresses the same problems as limiting T() from outside a module, but it's more consistent at the end of the day (eg, T() is useful for everything and can be expected for any type you use)
02:41:26*notfowl quit (Remote host closed the connection)
02:41:33ZZZZZZZZZhow does it adress the same thing?
02:41:44ZZZZZZZZZif you want to hide the constructor
02:41:49ZZZZZZZZZbut let them use the type
02:41:51filwitbecause you can enforce type construction goes though a specific path
02:41:54ZZZZZZZZZyou still cant with your system
02:42:07filwitsure you could
02:42:12ZZZZZZZZZhow so
02:42:26ZZZZZZZZZraise an exception on create?
02:42:33filwitwait.. how would you 'use' a type without allocating it anyways?
02:42:41*endragor joined #nim
02:42:51ZZZZZZZZZyou wouldnt directly construct it
02:43:11filwityou mean you want to specifically avoid T() syntax?
02:43:14filwitthen avoid it
02:43:20filwitcall a proc instead
02:43:27ZZZZZZZZZall im saying is
02:43:28filwitbut 'create' just allows you do overload that default
02:43:40ZZZZZZZZZif you want to hide it , but still let your library users use the type
02:43:43ZZZZZZZZZbut with no constructor
02:44:08filwitokay, but that could be addressed with a pragma.. if it was actually wanted, which it's not.. maybe only in the most rare of places
02:44:15ZZZZZZZZZwhat?
02:44:30ZZZZZZZZZits a big part of why its wanted imo
02:44:38filwitno
02:44:47filwityou're confused about what I meant
02:44:53ZZZZZZZZZno im not
02:45:03*fowl joined #nim
02:45:52ZZZZZZZZZlets say you just want a type factory
02:45:59ZZZZZZZZZ....
02:46:07ZZZZZZZZZhow would you do that with your method
02:46:19ZZZZZZZZZyou wouldnt be able to witouth the pragma
02:47:14filwityes, that's a good point.. and the only place I can think of where you'd want either a pragma to completely restrict T() syntax
02:47:19ZZZZZZZZZ(you could still have the factory, but they could bypass it with your constructors)
02:47:31ZZZZZZZZZfactories can have many forms
02:47:43ZZZZZZZZZlets say you want to build some html templates
02:47:45ZZZZZZZZZetc etc,
02:48:05filwityes, but let's count the amount of times you really want that vs all the places you just want a common syntax to construct types from modules you're unfamiliar with
02:48:23ZZZZZZZZZnew and init + prama for hiding
02:48:29filwitso you have a pragma for those rare cases, and you make the default syntax useful for the common case
02:48:51filwitor T() + 'create' + pragma for hiding
02:49:13ZZZZZZZZZyour create your override the T() right?
02:49:19ZZZZZZZZZeven in your own module...
02:49:24filwityes
02:49:35ZZZZZZZZZso you couldnt even construct it yourself
02:49:43ZZZZZZZZZwith a named constructor
02:49:52filwitwell by default it does allocation before calling 'create', but that can be changed with a pragma so the 'create' can allocate specifically
02:49:54ZZZZZZZZZyou would be stuck with all that overhead
02:50:39filwitwhich in turns eliminates the confusion about needing to call 'new' on ref types, cause it's done by default before your 'create' code is called
02:50:48filwitwait what?
02:50:53filwitthere is zero overhead
02:50:58*Perelandric quit (Ping timeout: 246 seconds)
02:51:11filwitnamed constructors and what i'm proposing are identical performance wise
02:51:13ZZZZZZZZZthere is, if you want a named constructor with a different set of checks
02:51:32filwitwhat?
02:51:51filwiteach unique set of parameters used with T() determines what 'create' proc to invoke (statically)
02:52:07*fowl left #nim ("Leaving")
02:52:45ZZZZZZZZZyes, you wouldnt be able to use the standard constructor yourself if you override if for your external API
02:52:56ZZZZZZZZZit*
02:53:23ZZZZZZZZZthats no good imo
02:53:48filwitsure, when would you want to? you can always go out of your way to allocate the type and avoid the 'create' function.. the entire point is to make T() more useful
02:54:22ZZZZZZZZZhow would you be able to allocate it on the stack?
02:54:26ZZZZZZZZZsince T() is the only way
02:54:32ZZZZZZZZZand if you overrride it...
02:54:37ZZZZZZZZZas per your proposal
02:54:58ZZZZZZZZZyou got no way to do it, except by playing with alloc + gc
02:55:02ZZZZZZZZZi mean not even
02:55:43ZZZZZZZZZit greatly limits what you can do
02:55:46filwitwell you could always allocate a byte array and cast it for stack allocation, and then just wrap that up into a system lib proc
02:55:52ZZZZZZZZZlol
02:55:56ZZZZZZZZZyes sure but..
02:56:10filwitno 'lol' really, that's pretty standard if there's a proc do to it
02:56:24filwitremember, you want to make it hard to do something which T() does not provide
02:56:29filwitthat's the entire point of this
02:56:40ZZZZZZZZZim talking in library code
02:56:43filwityou'd have the same problem with limiting the T() outside of the module and then trying to do this
02:56:46ZZZZZZZZZyou are the type owner
02:56:51filwiti understand
02:56:51ZZZZZZZZZyou can do whatever you want to do with it
02:57:03ZZZZZZZZZyou know your implementation details
02:57:03filwityou still could
02:57:22ZZZZZZZZZyou would just mix internal api with external api
02:57:35ZZZZZZZZZand thats not good
02:58:01filwitoften you want to use 'external' api inside your own module
02:58:18filwiti agree sometimes you might not want that, which is a good point (i hadn't considered)
02:58:21ZZZZZZZZZyou can if you want to right now,
02:58:27ZZZZZZZZZwith your proposal you wouldnt have any other choice
02:58:57filwityes you would.. Nim is a systems programming language you can always cast memory and have a safe system function which does that for you
02:59:07ZZZZZZZZZthats why i think the prama for .privateCtor. is the best way to deal with it
02:59:27ZZZZZZZZZyes but no need to cast, we have something perfectly fine right now
02:59:42filwitwell i will admit that my system does have more moving parts
02:59:49ZZZZZZZZZ(with the addition of the .privateCtor. pragma)
02:59:53filwitbut the trade off is universal syntax
03:00:29ZZZZZZZZZuniversal syntax but, confusing with the overrding imo
03:00:41filwitwhich is a big improvement to learning curve and general utility (when you don't have to lookup what proc to call to instantiate something)
03:00:48ZZZZZZZZZand then when its too confusing you would have half named constructor
03:00:50ZZZZZZZZZand half not named
03:01:22filwityes, but those constructors could look like this: Foo("bar") and Foo.load("bar") which is clean
03:01:56ZZZZZZZZZprefix arent clean
03:01:56filwitthat said, i do agree that the simplest path which addresses the most concerns makes most sense... and you raised some good points
03:02:01ZZZZZZZZZsince its not enforced
03:02:18ZZZZZZZZZsome would use it, some wouldnt
03:02:24filwitwell it is enforced.. the def looks like: 'proc new(T:type Foo, s:string)'
03:02:37filwitwhich is what I use in my code now
03:03:03ZZZZZZZZZthats confusing to me T_T
03:03:59filwitI think it's much cleaner than 'newT()', and works better with generic code to some degree (which is another point where my proposal beats named constructors)
03:04:29ZZZZZZZZZimo it is not more generic
03:04:42ZZZZZZZZZyou still have to know the exact parameters for instantiation
03:04:48ZZZZZZZZZso theres nothing generic to it
03:05:10ZZZZZZZZZright now, the real type constructor are more generic
03:05:10filwitwell it's Type + Params vs Type + Call + Params, so one down
03:05:44filwit"right now, the real type constructor are more generic" - exactly, and my proposal is an extension of those
03:05:53ZZZZZZZZZno i mean
03:06:11ZZZZZZZZZright now they always have 1:1 underlying memory -> to params
03:06:16ZZZZZZZZZnot so much with yours
03:06:33ZZZZZZZZZType(fieldn: Typen)
03:06:41ZZZZZZZZZyours will just be random
03:06:49ZZZZZZZZZto whatever the library maker wants
03:06:58ZZZZZZZZZso it will be confusing
03:07:01filwitno more random than what your forced to do now, which is use 'newT()' anyways
03:07:17ZZZZZZZZZbut T() right now is always the same
03:07:23*pregressive quit (Remote host closed the connection)
03:07:27filwitso?
03:07:27ZZZZZZZZZnamed constructor do as they please
03:08:17ZZZZZZZZZwith newT, initT you expect it to require some special care
03:08:52ZZZZZZZZZaka, might have to try, or watch if it return null
03:08:56ZZZZZZZZZor whatever else
03:09:01filwitthe main issue is "i want to construct a *valid* object".. there's a couple solutions to that which Nim is lacking a bit on right now.. there's a reason we're even talking about a {.noCtor.} pragma, because people are so attracted to T() that they end up using it when they shouldn't and get runtime validation errors
03:09:23ZZZZZZZZZyes
03:09:31ZZZZZZZZZthe privatector is all thats needed
03:09:34*dtscode joined #nim
03:10:27ZZZZZZZZZwith your proposal, if i want bypass by external API , i would have to use named constructor anyway
03:10:31filwitso my solution means the syntax people are very attracted too would be useful and could be expected to be used for any and all types throughout the code.. so our solution to "i want to construct a valid object" is always clear.. just call the TypeName
03:10:31ZZZZZZZZZmy*
03:10:56filwityes, but this isn't the *majority* of what code wants to do
03:11:21filwitit makes most sense to make what people want to do, and what they want *most often* to do the way to actually do it
03:11:24ZZZZZZZZZisnt nim called a systems language programming?
03:11:34filwitthen have things which help with the corner cases
03:12:08ZZZZZZZZZnew and init are fine
03:12:17ZZZZZZZZZrust doesnt have constructor
03:12:31ZZZZZZZZZcheckmate !
03:12:46filwityeah, was going to say that's irreverent
03:12:57filwitirrelevant*
03:13:25filwitand what i'm proposing doesn't limit Nim from being a systems programming language in any way
03:13:51filwityou say 'new' and 'init' are fine.. i saw "the situation could be better" I don't see how my point is invalid
03:14:04ZZZZZZZZZit would be worse with your proposal imo
03:14:21filwitnot in the majority of code
03:14:44ZZZZZZZZZto me it seems like it would
03:14:55filwitonly none-common could would require a little more depth.. only on a tad more than {.noCtor.}
03:14:58ZZZZZZZZZyou always would have to look at the type definition + the constructors
03:15:07filwitno
03:15:09ZZZZZZZZZto know if you really have params -> underlying structure matching
03:15:32filwitthe compiler would say "can't use those params.. try one of *these*"
03:16:12filwitwhich it could do better because 'create' is tied to T(), unlike new/init
03:16:35ZZZZZZZZZyes, mixing 2 things together
03:16:40ZZZZZZZZZtype creation + validation
03:17:40filwitwhich is exactly what we want. the whole reason for {.noCtor.}, etc
03:18:01ZZZZZZZZZyes, while being able to create the type as you wish inside your own library
03:18:08ZZZZZZZZZyou just hit the nail on the head
03:18:10filwitwhich you still could
03:18:28ZZZZZZZZZwith only the pragma it would be fine
03:18:31filwitjust you have to go further out of your way to do it, which is a feature, not a limitation
03:18:34ZZZZZZZZZyour proposal has nothing to do with it
03:19:06ZZZZZZZZZyou dont want to make it harder in your own private code
03:19:14ZZZZZZZZZyes you want to make it harder externally
03:19:16ZZZZZZZZZbut not internally
03:19:20filwiteither the {.noCtor.} or my solution would address the main concerns.. but mine does it with keeping syntax people are obviously attracted too
03:19:22*endragor quit (Remote host closed the connection)
03:19:46ZZZZZZZZZyours hide the standar ctor to yourself
03:19:48filwit"but not internally" this isn not always true
03:20:08ZZZZZZZZZyou know what you can and cannot do with your own type
03:20:16ZZZZZZZZZif you shouldnt do it in some instance, dont do it
03:21:01filwitactually, no what am i thinking... you just use an internal named constructor if you want an "allocate without setup" inside your module
03:21:04filwitso simple
03:21:13ZZZZZZZZZyou couldnt
03:21:19filwityeah you could
03:21:32filwitsorry.. i'm getting annoyed, i should be
03:21:34ZZZZZZZZZsince you just override the constructor
03:21:59filwitno, you'd just have a 'proc customNew: Foo'
03:22:10filwitinternally
03:22:54ZZZZZZZZZso wait, with your proposal what would happen with a 'proc customNew: Foo' outside of your module?
03:23:03*endragor joined #nim
03:23:12ZZZZZZZZZ...
03:23:21ZZZZZZZZZit wouldnt fix anything if it allows it
03:23:25ZZZZZZZZZand if it doesnt its even worse
03:23:49dtscodeWhat proposal?
03:24:10filwitdtscode: https://gist.github.com/PhilipWitte/0ca58b9655a6f3fd8ff0
03:24:29ZZZZZZZZZfilwit, what would happen with a 'proc customNew: Foo' outside of your module
03:24:43filwitZZZZZZZZZ: idk actually.. but to what is supposed to happen here with {.noCtor.} either?
03:24:54*endragor quit (Remote host closed the connection)
03:25:08filwitthat's a flaw with both systems i think...
03:25:15filwitand they probably have the same solution
03:25:25dtscodehmmm
03:25:38ZZZZZZZZZi think it would disalow the result auto instanciation i guess or something
03:25:58ZZZZZZZZZno clue how that would be implemented tho
03:26:17ZZZZZZZZZbut its clear, since its a noctor pragma
03:26:27ZZZZZZZZZwith your system... we still need the private imo
03:26:32ZZZZZZZZZotherwise..
03:27:10filwiti don't see how mine would be any worse here, really.
03:27:26ZZZZZZZZZbecause yours is with different parameters
03:27:51ZZZZZZZZZmine is just to disallow instanciation of the type completly outside of the module
03:28:02ZZZZZZZZZit does nothing else
03:28:09*dddddd quit (Ping timeout: 245 seconds)
03:28:35filwitwell yeah, but the solution is the same, you simply cannot do "proc f: Foo =" unless Foo is proven to be setup in a valid way or something
03:28:44ZZZZZZZZZyou could still do 'proc customNew: Foo', but would have do do = 'initT'
03:28:58ZZZZZZZZZyes anything that return a Foo would work
03:29:08ZZZZZZZZZand since the only valid way is inside the module..
03:29:25ZZZZZZZZZas i said im not versed with the internals of the compiler
03:29:37ZZZZZZZZZbut it would prefer auto instanciation of result
03:29:42ZZZZZZZZZor something
03:30:09filwiti don't see your point (against my proposal) in your last few sentences. Having to do 'initT' or whatever is exactly the same solution to mine
03:30:25ZZZZZZZZZhow so?
03:31:03filwitin mine you could do 'initT' or T() or whatever else at your disposal, the semantic checking would be the same
03:32:42filwitanyways, you've raised some good points I hadn't considered before (about using T() within a module).. so thanks for that
03:32:45ZZZZZZZZZright now, everyone implements newT initT, so everyone uses that method, nothing would break
03:33:16ZZZZZZZZZif you implement a new named constructor it doesnt change anything
03:33:22*taesoo joined #nim
03:33:30filwiti don't find that very compelling.. i'm not throwing that out of the equation, but from a long-distance standpoint I don't see how that makes mine solution any worse
03:33:35ZZZZZZZZZbut with your proposal, if you ovverrride the constructor, boom
03:34:06filwityes, mine solution is not fully backwards compat
03:34:25filwitbut it could actually be mostly
03:34:29ZZZZZZZZZand would still need the pragma
03:34:45ZZZZZZZZZif you really dont want to expose your constructor
03:35:01filwityou enable it via {.experimental.} and give compiler warnings about the upcoming change when a 'create' function is found in existing code
03:35:31ZZZZZZZZZsure, but as i said the pragma would be needed anyway to hide the constructor, if you really dont want to expose any
03:35:42ZZZZZZZZZso the 2 arent competing with each other
03:35:49ZZZZZZZZZyours is an addition
03:36:00filwit"if you really dont want to expose your constructor" - yes, but again, lets measure the amount of times you want to do that compared to types which have 1 or few ways to construct
03:36:00ZZZZZZZZZto the pragma
03:36:27ZZZZZZZZZsure, all im saying is they arent the same, the pragma doesnt prevent your feature
03:36:34filwitand also, I'm not fully convinced there isn't some other solution to that problem
03:36:38ZZZZZZZZZthey are for different purpose
03:36:51ZZZZZZZZZhide ctor / force checks
03:37:04filwitthat's actually true..
03:37:35ZZZZZZZZZthey arent mutually exclusive
03:37:39ZZZZZZZZZyou could have both
03:37:46filwitmy system is all about extending T() functionality to be more useful to types.. while {.noCtor.} kinda stands by itself.. even if they address a similar problem
03:38:09filwitsimilar *set* of problems that is
03:38:12ZZZZZZZZZ(for the purpose you would use noctor)
03:38:50ZZZZZZZZZand it would be better as privateCtor or something, since you still want to be able to construct it somewhere ;)
03:39:31filwitin fact.. that's convinced me. bravo. We should add the .noCtor. pragma first.. it's easier and accomplishes the same thing without breaking code.. then eventually add my constructor extensions for some later compiler 2.0 or whatever
03:39:38ZZZZZZZZZ:)
03:39:48ZZZZZZZZZgreat success!
03:39:53ZZZZZZZZZviva nim!
03:40:40*endragor joined #nim
03:40:46filwiti still like T(..) as a 'universal' syntax for constructions, but from where we are now, {.noCtor.} makes more sense and is best ATM.. I don't actually care about this a ton either (my code works and is clean right now), so this gives us more time to debate it and more time for me to make it.
03:41:49ZZZZZZZZZyes, the .privateCtor. would be simpler to add, and i think everyone could agree, your proposal is ok on the basis
03:42:00ZZZZZZZZZbut some details..
03:42:07ZZZZZZZZZit would need to be reworked
03:42:24*gsingh93_ quit (Ping timeout: 256 seconds)
03:42:37ZZZZZZZZZto not restrict the internal use
03:43:22ZZZZZZZZZanyway i think i filled enough irc log pages for today
03:43:40ZZZZZZZZZtime to watch some iZombie + Veep
03:43:46ZZZZZZZZZlater
03:43:49filwitlater, thanks for the debate
03:43:54ZZZZZZZZZu2 <3
04:00:50ZZZZZZZZZ+ interfacing with c would be harder, while overrriding default constructor for your external api
04:08:32*endragor quit (Remote host closed the connection)
04:16:26*kokozedman_ joined #nim
04:18:35*saml_ quit (Remote host closed the connection)
04:23:35*vendethiel joined #nim
04:25:21*endragor joined #nim
04:49:41*vendethiel quit (Ping timeout: 250 seconds)
04:57:39*dtscode quit (Ping timeout: 244 seconds)
05:07:16*vendethiel joined #nim
05:15:52*yglukhov_ joined #nim
05:22:17*jbomo left #nim (#nim)
05:24:36*ddl_smurf quit (Quit: ddl_smurf)
05:30:04*vendethiel quit (Ping timeout: 256 seconds)
05:36:41*kokozedman_ quit (Quit: Leaving)
05:36:57*yglukhov_ quit (Quit: Be back later ...)
05:41:13*intra quit (Ping timeout: 255 seconds)
06:08:05*pregressive joined #nim
06:10:33*taesoo quit (Ping timeout: 240 seconds)
06:12:43*pregressive quit (Ping timeout: 256 seconds)
06:18:31*dtscode joined #nim
06:28:03*polde joined #nim
06:29:24dtscodeCan someone tell me why https://bpaste.net/show/d2e54b56762a is producing:
06:29:24dtscodenimbus.nim(22, 54) Info: template/generic instantiation from here
06:29:24dtscodelib/pure/asyncdispatch.nim(1331, 44) Error: index out of bounds
06:31:01*BitPuffin|osx quit (Ping timeout: 264 seconds)
06:34:50filwitdtscode: no idea, could always be a bug in asyncdispatch.. if line 22 is the culprit, it looks like the {.async.} macro is hitting an error with semantically analyzing your code. I would suggest commenting-out parts of it to isolate what section .async. is having trouble with, then make a bug report when you've narrowed it down.
06:35:03dtscodeThanks
06:36:34*yglukhov_ joined #nim
06:39:53filwitdtscode: looking that the asyncdispatch code (here: https://github.com/Araq/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1331), it looks like the {.async.} macro has a bug with handling 'discard' statements.. perhaps this is related to the recent change where 'discard' can now be used instead of 'nil' for empty 'of' blocks?
06:40:19dtscodeOh did I use discard?
06:40:22dtscodeSilly me
06:40:27filwitno you used 'nil'
06:40:40dtscodeThat should work though
06:40:50dtscodeI was using it before and it compiled
06:40:54*Matthias247 joined #nim
06:41:58filwityeah I'm just guessing here, but I know something recently changed with that, so perhaps there's a bug where the 'nil' now looks like a 'discard' stmt, but doesn't have correctly structured AST and thus hits the index-out-of-range due to the {.async.} macro assuming an AST structure.
06:42:16dtscodeOh well. I'll debug it in the morning
06:42:42filwitk. make sure you ask dom96 when he's around. He's the asyncdispatch author
06:42:52dtscodeYeah. Thanks for the tips :D
06:43:09filwitoh.. pfft
06:43:32filwitdtscode: you are using the discard block to comment out the large string of code.. try running it without that
06:44:16dtscodeOh... hmmm... That could also be an issue
06:44:17filwitthere's probably a bug in {.async.} where it doesn't properly handle discard statements witch parameters (just a guess)
06:48:38filwityeah, that's gotta be it.. looking at the asyncdispatch code it looks like it assumes all 'discard' statements will either appear as an empty statement or one followed by a call.. so when it's followed by a string it passes the 'isEmpty' check but then tries to check the call's child nodes, which a string doesn't have, thus the out-of-bounds
06:49:54*Matthias247 quit (Read error: Connection reset by peer)
07:01:01*lyro quit (Read error: Connection reset by peer)
07:01:29*polde quit (Quit: q)
07:01:57*polde joined #nim
07:02:33*Ven joined #nim
07:06:29*BlaXpirit joined #nim
07:07:03*Ven quit (Ping timeout: 250 seconds)
07:08:52*endragor_ joined #nim
07:12:13*endragor quit (Ping timeout: 256 seconds)
07:17:35*jubalh joined #nim
07:17:37jubalhhi
07:19:01*gokr joined #nim
07:21:56filwitjubalh: hello
07:22:47*endragor_ quit (Remote host closed the connection)
07:22:58jubalhfound nim today, thinking about checking it out :) just started with go 3 months ago though
07:23:15jubalhand now i stumbled upon the famous go vs rust vs nim discussion...still reading my way through it
07:27:59filwitdtscode: fixed your bug: https://github.com/Araq/Nim/pull/2767
07:28:46filwitjubalh: welcome to #nim, let us know if you have questions.. though this time of night most of Nim's community is sleeping.
07:28:56dtscodefilwit: :D
07:29:02dtscode<3
07:29:27filwit:)
07:32:31jubalhits 9:30 am here :)
07:34:57filwit00:32 here :)
07:34:57filwitmost of #nim is on UK/US time i think.. some of us just stay up late
07:35:25jubalhi see
07:35:35jubalhi suppose many of you already went through the rust/go/nim thing?
07:35:46filwitlink?
07:36:51filwiti came from D (use C# and Javascript a lot too).. only barely tried both Rust and Go, though I've learned about Rust a lot lately (cause of it's unique take on memory safety)
07:38:35jubalhi am coming from C (was embedded programmer) not work as a php dev
07:38:43jubalhbut in my free time i try to look at other languages
07:38:59jubalhlink..well among others i just read http://goran.krampe.se/2014/10/20/i-missed-nim/
07:39:38gokrJust read an interesting article why the Cog guys aren't that hot on LLVM, not really "nim" stuff, but very interesting read: https://clementbera.wordpress.com/2014/05/28/the-sista-chronicles-viii-integrating-llvm-in-cog/
07:40:04gokrjubalh: Oh, that's my article ;)
07:40:20gokrThere's more at http://goran.krampe.se/category/nim
07:40:52gokrjubalh: You are in my tz then, country?
07:49:13*gokr coffee...
07:53:51jubalhgokr, germany / switzerland
07:55:06jubalhgokr, hehe you noted it already in the article, i will say it anyway: i am also one of those who prefers return values to exceptions. i really like that Go has the way of returning multiple values and so can return "err"
07:55:40synthmeatto be perfectly honest, i skipped go and rust seeing that it would be very hard to keep text width under 80 columns :D
07:55:47synthmeatin nim that's easy :)
07:55:52*OnO joined #nim
07:56:06jubalhon the first glance, nim looks eaiser to read than rust
07:56:10synthmeat(morning, nim-people)
07:56:44jubalhi dont believe in the 80 columns thing :) doesnt suit wide monitors
07:57:18synthmeatsure does, just put many of them! :)
07:57:24jubalhhmm after basic, a second langauge was object pascal, that makes me like nim too :)
07:57:51filwiti don't follow 80 width, but i do keep my code short enough to put two side-by-side easy on a 1080p
07:57:52synthmeati can squeeze in 3 80-column editors on 11" laptopt
07:58:20jubalhoh my :D
07:58:26jubalhfor me even 14" is too small
07:58:43jubalhhmm nim community seems nice, and website and information too
07:58:45synthmeatwhen i used external display, i was mostly keeping it pivoted too
07:59:09jubalhgo community is also very nice. and rust i didnt look at yet
07:59:12jubalhwill be a hard choice
08:00:52synthmeatwhadaya wanna build with it?
08:01:33filwitjubalh: just try writing some small program (related to the work you want to do) in all three and see which one feels best to you
08:05:45synthmeati'm a gonna do games with it! :)
08:05:55filwitboth Nim and Rust are very fast and have good memory control (Nim's GC is not like Go's, or so I've heard), and Go has excellent web features (again, only heard)
08:05:56jubalhfilwit, thats what i planned to do :)
08:05:57*coffeepot joined #nim
08:06:06synthmeatjust need to evaluate emscripten webgl output first
08:06:21gokrjubalh: Regarding communities, I don't know the Go/Rust communities really (although I have only heard good things) - but Nim has one "advantage" in my book and that's the fact that its smaller and "grass root".
08:06:32jubalhactually i also thought about starting with an web application (since that what i do at my day job in php right now), so anybody ever tried jester?
08:06:35jubalhhttps://github.com/dom96/jester
08:06:52jubalh"grass root", gokr ?
08:06:59filwitI like Nim because it's syntax is clearer than the others IMO, combined with it's GC which makes it perfect for Game Engines/Scripting
08:07:11gokrjubalh: The web forum is written using Jester etc, its the best example of a fairly large web app in Nim.
08:07:36*Trustable joined #nim
08:07:43synthmeatgokr: i had some luck with few of you guys being awesome, but in general, the community is slightly leaning on "hostile to newcomers/n00bs"
08:07:46gokrjubalh: What I meant is that in Nim - decisions are made here basically, Araq being top dog of course - but there is no Mozilla or Google pulling shots.
08:07:47synthmeatjust a bit!
08:07:48jubalhgokr, interesting :)
08:08:07jubalhgokr, ah i see
08:08:12synthmeatit's fine though, i like no-nonsense approach to answering questions, particulary silly ones
08:09:01jubalhi will first read as much about go/rust/nim as i can, to get a picture and then start implementing the same program in all of them, i guess
08:09:03gokrWell, I agree that some people here (nudge, nudge) can be a bit ... "less patient" sometimes, but I wouldn't call it hostile.
08:09:14*Ven joined #nim
08:09:28synthmeatgokr: "slightly leaning on 'hostile [...]'" is what i said though :)
08:11:19gokrjubalh: Go is very "practical" with a good toolset (so I have heard) but seems... very boring. And not as wide in covering domains I would guess.
08:11:42jubalhi did some small console applications in go, and a simple web wiki
08:11:48gokrNim also has one killer advantage sometimes missed - and that is integration with C/C++ eco systems.
08:11:55jubalhwhat domains would you put nim in?
08:11:59synthmeatgames!
08:12:05jubalhoh it does? hmm but go can also use c/c++
08:12:14synthmeatfast pseudo-scripts
08:12:39gokrjubalh: "Use" is one thing, but since Nim compiles via C or C++ - integration is VERY good.
08:12:53*vendethiel joined #nim
08:13:10gokrAraq wrapped Urho3D using c2nim in a week or so - mostly fully automated. That's a fairly big C++ game engine.
08:13:12synthmeati can't read the generated C code though, and i kinda like to think i know a bit of C
08:13:33jubalhhmm but will it be syntactic nice nim then?
08:13:35jubalhor c style nim?
08:13:47gokrIt can be made very nice Nim indeed.
08:14:41gokrAs an example, in Urho3D there is a vector container - and with a bit of simple code you can iterate over them just like a normal Nim container.
08:15:07*strcmp1 quit (Ping timeout: 256 seconds)
08:15:10filwituse some form of prettifier on the C code to make it more readable.. but mostly when you're looking at the C code it's to look at a specific function, so just using 'find' and then reading the code is often enough.
08:15:50synthmeatfilwit: actually, yeah, that's what i ended up doing (just looking up particular functions)
08:15:53synthmeatso no biggie
08:16:13gokrjubalh: Example: https://github.com/3dicc/Urhonimo/blob/master/examples/huge.nim#L175
08:16:39jubalhgo integrates very nicely into vim. nim too?
08:17:11gokrjubalh: The "magic" that makes that work are here: https://github.com/3dicc/Urhonimo/blob/master/examples/huge.nim#L22-35
08:17:14filwitIDE support is still a more rocky situation than the others (it's a smaller community)
08:17:32filwitbut that's been improving well lately
08:17:38synthmeatfilwit: vim plugin is amazing though
08:17:57synthmeati don't even know how in the world it catches all that via syntastic
08:17:59jubalhwell i just need stuff like "jump to definition" and maybe autocompletion.
08:18:03filwitsynthmeat: am linux user for a few years now but have only use vim like 5 times in my life :P
08:18:36gokrjubalh: Regarding domains, I think Nim covers basically what C/C++ would cover plus ability to write scripts and web stuff quite nicely. So its a very wide net.
08:19:08filwitsynthmeat: i should probably try the vim nim plugin though, just to see what it's like
08:19:12*notfowl joined #nim
08:19:13gokrjubalh: Both those Nim has via nimsuggest (compiler running in service mode)
08:19:21jubalhthis looks nice https://github.com/ckkashyap/nim-xv6
08:19:29synthmeatwhat it sucks a bit is parallelism, right?
08:20:36jubalhalso i think that this is quite a nice read https://news.ycombinator.com/item?id=9050114
08:21:05synthmeatyeah, that was a big event in nim history :)
08:21:12gokrEh... Nim as a language has a lot of ammunition when it comes to concurrency. Some of it is not that mature perhaps.
08:21:25jubalhhm actually i joined #rust at moznet
08:21:39jubalhand i have to say, community here seems a lot nicer (at least the last 10 minutes :) )
08:21:58jubalhwhat do you guys think i an advantage of rust that nim doesnt have?
08:22:08filwitsynthmeat: parallelism is a pretty good situation in Nim. You should ask Araq or Jehan about it for more detail. There are some things that are challenging you need to be aware of though. Like thread-local only GC.
08:22:19jubalhwould be interesting to hear your opinions on it, though i probably know gokr already from his blog :)
08:22:38gokrThe obvious advantage of Rust is its memory model - but I would only consider it an advantage if you really *need* it - and I argue most of us really don't.
08:22:39jubalhhmm Araq studied at KIT in germany?
08:22:56jubalhnot yet familiar with its memory model, will read up on it
08:23:12synthmeatjubalh: nah, i won't pollute with noise (= my oppinions), but gc across threads is a biggie kinda
08:23:28gokrThat's the key thing in Rust - the absence of a GC and a system of lifecycle/pointer ownership to know when stuff can be deallocated or not.
08:23:43jubalhsynthmeat, and gc across threads is what nim has?
08:23:57jubalhhmmm i see gokr
08:24:02gokrNo, Nim has GC per thread.
08:24:08gokrWhich I personally think is brilliant.
08:24:39filwitjubalh: Rust's memory design is nice for concurrency, but IMO it's life-time var and strict ownership rules aren't good for some domains, it's a lot of mental overhead which Nim's GC doesn't have
08:24:41gokrSo Nim has been leaning towards shared nothing concurrency so far - GC per thread and copy between threads.
08:25:56gokrAlthough it sure is worth noting that: a) The GC is written in Nim, you can actually run with two different GCs and... b) There are ideas of also adding shared structures for non copying sharing between threads.
08:26:11filwitjubalh: by "nice for concurrency" i mean they currently have a bit more *free* safety features than Nim in parallel code.. but I'm actually new to this stuff and am not the best person to talk about it (could be giving some misinformation out)
08:26:15gokrBut the base idea - let threads communicate over channels with "messages" - is sound IMHO.
08:26:58gokrAlso, Nim has the automagic parellell stuff - which I know nada about. But it sure looks cool :)
08:27:34gokrjubalh: I wrote a simple TCP server using spawn/threadpool - one of my articles describe it. Very simple, worked great, good performance IMHO.
08:28:12filwitjubalh: that said, Nim and Rust are very comparable in performance in general on almost every benchmark so far, and actually most of Rust's ownership system could be eventually applied to Nim's ptr model.. and viseversa, where Rust could gain better GC support (though i don't think their syntax can be fixed so easily :\ but that's pretty subjective)
08:28:34jubalhactually i have to say i never used threads/paralellism. i was a embedded c dev most of the time. on quite limited hardware. first time i used channels was in the last 3 months with go. and actually just one time to test it out but not in an actual program where it was needed
08:29:23jubalhhmm if its so much the same i also prefer the syntax of nim over rusts (just from a quick look)
08:29:26notfowljubalh, thanks for the link
08:29:34jubalhokay, will be back later
08:29:36gokrAs a sidenote, we are betting on Nim at 3DICC - we hired Araq so... :)
08:29:38jubalhnotfowl, which one? ;) np
08:29:46filwitjubalh: I never really played with parallel code before Nim either.. and it was really easy with Nim's parrallel/spawn system
08:29:48notfowlthis ycombinator post
08:29:58jubalhfilwit, 3DICC?
08:30:00jubalhnotfowl, :)
08:30:13jubalhfilwit, okay cool, that i will check it out soon
08:30:36gokrjubalh: http://forum.nim-lang.org/t/870#5166
08:31:21filwitjubalh: out of curiosity, where/how did you hear about Nim?
08:33:47gokrjubalh: So welcome to Nim, and feel free to ask anything.
08:37:26*endragor joined #nim
08:39:09*strcmp1 joined #nim
08:42:13*BlaXpirit quit (Remote host closed the connection)
08:42:35synthmeatgokr: i'd assume HN, like me and most others
08:42:56filwitsynthmeat: think you meant me
08:43:07synthmeatah, yeah, sorry
08:43:24synthmeatstill sippin' morning coffee :P
08:44:04*BlaXpirit joined #nim
08:50:12gokrQuite a lot of cool code being written out there - just perused bluenote's github repos
08:51:05gokrWonder if we would benefit from "harvesting" a few really good things into the base - especially say collection implementations like bluenote's heap etc.
08:52:10*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
08:54:12jubalhno not HN :)
08:55:14jubalhi heard about nim several times, dont know where exactly. probably because i was learning go or on some news site. but didnt pay much attention. but today i have my free day (and thus some time), and then Copyfree posted about nim, and i thought "okay lets get informed about this now"
08:56:34gokrdef has lots of cool articles on Nim: http://hookrace.net/blog/
08:56:46jubalhcool thanks
08:58:04*vendethiel quit (Ping timeout: 272 seconds)
08:58:06*xificurC_ quit (Quit: WeeChat 1.1.1)
08:58:26*xificurC joined #nim
08:59:48*ddl_smurf joined #nim
09:00:32*TEttinger joined #nim
09:09:35*jubalh quit (Quit: Leaving)
09:10:51*ddl_smurf quit (Quit: ddl_smurf)
09:21:23dom96dtscode: yes, report it as a bug if you haven't already.
09:22:10filwitdom96: i already fixed it: https://github.com/Araq/Nim/pull/2767
09:27:26*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:33:33dom96filwit: I don't think that's the right way to fix it.
09:33:45dom96You should only need to touch the discard code
09:33:56*Kingsquee quit (Quit: Konversation terminated!)
09:33:59dom96and I think you've introduced bugs by changing the other code
09:34:49dom96that check for nnkIdent is not pointless
09:35:11filwiter, yeah I meant to ask in the PR to double check the nnkIdent checks I removed.. but as far as I'm aware a nkCall and nkCommand will always have a nkIdent as a first child after that, so those checks where pointless
09:35:32filwitoh i see, you said it wasn't pointless.. in that case there was a different bug
09:36:08filwityou checked for nkIdent after one command, but not the other (which is also part of why I assumed it was pointless)
09:36:11dom96The case is more clear too, and sets it up to be extensible.
09:36:46filwiterr.. okay, sorry.. just not how I code and figured it was just left-over from when it had more options
09:37:00dom96As for separating the website and async changes.
09:37:06dom96You should create a branch for each PR
09:37:13dom96and commit the changes to the branch
09:37:34filwitI think i had already pushed those changes and meant to make a PR before..
09:37:47filwitbut I'll fix everything
09:38:49filwiter no wait, i did include those changes here.. i figured I had meant to make a PR and figured I'd just include it now.. but if you want two PRs for testing purposes that's cool
09:38:53*Senketsu quit (Ping timeout: 246 seconds)
09:39:45*vendethiel joined #nim
09:40:27dom96The only change that's really needed is to check for nnkCommand I think
09:40:59filwiti thought you said it was needed
09:41:05filwitso should I revert or not?
09:41:38filwitwait you wanted the case/of, nevermind
09:42:08dom96if node[0].kind != nnkEmpty -> if node[0].kind == nnkCommand
09:42:58gokrHehe, fixed my first bug in Nim ;)
09:43:10filwitwhat if you use with 'discard await(..)` which will be nnkCall not nnkCommand
09:43:51filwitit needs to be if node[0].kind in {nnkCall,nnkCommand} but i wasn't sure you wanted both calls and commands..
09:44:05filwitthough i did choose the wrong one (nnkCall).. not sure why i did that
09:44:50dom96filwit: You can do that, but I don't think I support nnkCall anywhere else.
09:45:38filwitokay well I'll just make it == nnkCommand then (to be consistent).. just support nnkCall later if it's requested i suppose
09:46:16filwitbut with nkCommand, wont the first child always be nnkIdent?
09:46:28filwiti'm pretty sure it is.. cause that defines it's name
09:46:35filwitin fact I'm positive it is
09:47:56dom96I added that as a response to an error
09:48:03dom96perhaps I am being over cautious
09:48:05filwiteven the `of nnkAsgn:` block I changed doesn't check for `if .kind == nnkIdent` in the original code
09:48:08dom96but it doesn't hurt to leave it in
09:48:43dom96gokr: yay :)
09:59:49*ddl_smurf joined #nim
10:00:16filwitshit i was trying to reset my Nim branch and accidentally reset my Aporia one :S
10:00:32filwitwith --hard...
10:00:50filwitanyways to get back from that.. i forgot..
10:01:41*vendethiel quit (Ping timeout: 250 seconds)
10:02:18filwitnevermind, i'll just repull that repo cause I'd already pushed those changes
10:03:13*synthmeat quit (Quit: WeeChat 1.2-rc2)
10:03:36*ddl_smurf quit (Client Quit)
10:04:11*the9to5 quit ()
10:04:20gokrWoa! 500 open issues! Nice that I can push it down to 499 then ;)
10:05:28*synthmeat joined #nim
10:07:22*vendethiel joined #nim
10:07:27gokrI am such a github n00b.
10:10:43coffeepotI'm dreading setting up a github account to publish my sql server module for nim, never done any open source stuff before o_O
10:11:37gokrIts actually not that hard
10:11:47gokrLots of guides to follow
10:12:14coffeepotI don't doubt it, it's more the fact that I've never published my code for all eyes to see! :D
10:12:32gokrHehe, yeah
10:12:51coffeepotI'm sure if people are interested they'll give me some better ways to do stuff, I'm writing very 'simple' nim code, no macros, templates etc
10:13:04gokrcoffeepot: Simple is good IMHO
10:13:41coffeepotI tend to agree, I'm impressed with some of the macro stuff, but I find it hard to get my head around. I'm getting there though, it's starting to make sense!
10:14:21gokrIt does open up a lot of ways to evolve Nim. That doesn't mean everyone need to use them.
10:14:25coffeepotI just figure if there's a module for sql server it allows people like me who want to hack a script for work can do so with nim
10:14:50gokrYup, those things are quite important. And often a brute of work.
10:15:18coffeepotI find templates particularly awesome because I've found that sometimes when you tell a language inline it has its own ideas!
10:15:34gokrDid you wrap something or did you write something directly to their protocol?
10:16:15coffeepotI'm using odbcsql.nim (yes, odbc is the preferred protocol to MSSQL, unless you use ADO.NET)
10:16:34coffeepotODBC is awkward to work with. What I've got atm is quite different from the other higher level wrappers
10:16:55coffeepotfor instance I'm using object variants to store data atm, whereas the other higher level modules use strings
10:17:53coffeepotso far I have queries running, fetching results. So, it's "usable" in the most basic sense. Am working on implementing parameters atm
10:18:30*gokr realizing I should add a test to my PR...
10:18:51gokrnice!
10:19:23coffeepotwell, I hope so - only doing it when i have spare moments at work so it's going slowly but getting there!
10:20:21coffeepotwondering if I should use the `%` operator for parameters a la strutils
10:20:31coffeepotmight be confusing tho
10:29:24*vendethiel quit (Ping timeout: 252 seconds)
10:36:34*the9to5 joined #nim
10:37:03*lyro joined #nim
10:42:50*the9to5 quit ()
10:43:44filwitdom96: updated the Nim PR to only include the needed change: https://github.com/Araq/Nim/pull/2767
10:44:08dom96filwit: tested it?
10:44:22Xaseronhow can i do a *2 increment in nim? like in c "for (int i = 1; i <= array.Length / 2 + 1; i *= 2)"
10:44:23filwityeah
10:44:31filwitdom96: using the code in the PR
10:44:45dom96filwit: Merged.
10:44:54dom96filwit: have you tested whether discard await ... works?
10:45:36filwitno, which is stupid of me (not thinking well, been up all night)
10:45:40filwitlet me test it real quick
10:52:01*Ven joined #nim
10:54:26filwitdom96: it works fine
10:54:34dom96good
10:54:59filwitbtw, why doesn't the {.async.} macro automatically convert the return type to Future[T]?
10:55:00coffeepotXaseron can you do for i in countup(0, max, increment)?
10:56:13coffeepotsorry that's probably not what you want :/
10:56:41gokrXaseron: var a = [1,2,3,4,5,6]
10:56:44gokrXaseron: for i in countup(1, a.len, 2): echo(a[i-1]); echo(a[i])
10:57:09gokrBut yeah, perhaps we have some other ... thing to use :)
10:59:37Xaseronhmm, perhaps i should use while loops instead
10:59:51*ddl_smurf joined #nim
11:00:15coffeepotdoesn't countup work for what you want?
11:02:03gokrOh... wait, *2?
11:02:22*gokr smacks forehead
11:02:26dom96filwit: Because I opted for that to be explicit.
11:03:05gokrXaseron: Make your own iterator
11:04:05Xaseronthats a good idea
11:05:25*boopisaway is now known as boop
11:09:38*coffeepot realises *2 not same as +1 :3
11:09:44coffeepot+2 even lol
11:10:29gokrXaseron: Something like: https://gist.github.com/gokr/a14df619dca672cdea8b
11:10:53*gokr and there I go back to work...
11:11:10Xaserongokr: thx
11:11:37gokrIterators are quite slick in Nim
11:13:53pigmejgokr: just like in python :-)
11:14:28gokrWell, in Nim they are inlined
11:16:28gokrBut yes, similar to Python using yield etc. In Smalltalk we don't need that - we just use closures ;)
11:17:47*OnO joined #nim
11:18:05*synthmeat quit (Quit: WeeChat 1.3-dev)
11:19:37*synthmeat joined #nim
11:21:52*emilsp left #nim (#nim)
11:37:00*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:49:47*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
11:53:46*OnO joined #nim
11:57:02vikatonBlaXpirit: does nimm-csfml accept mp3 files?
11:58:46BlaXpiriton
11:58:47BlaXpiritno
11:58:58vikatono :(
12:00:05*Ven joined #nim
12:04:42*vendethiel joined #nim
12:11:46*dddddd joined #nim
12:19:37*OnO is now known as ono
12:39:32*Senketsu joined #nim
12:40:39coffeepothas anyone tried to build a windows service in Nim? Not sure where to start
12:42:18BlaXpirityes, someone has tried
12:43:37coffeepotdon't suppose they left some code breadcrumbs for me to pick through?
12:48:12coffeepotBlaXpirit, can you say who tried maybe? Perhaps they have a github or something I can look at
12:48:38r-kucoffeepot: all you need for windows service is msdn docs. its totally same as c api.
12:48:48BlaXpiriti dont remember, they gave up probably
12:49:07coffeepotah okay... guess I'll be making a wrapper for that then somewhen!
12:49:12coffeepot:)
12:50:00coffeepotcan't be that difficult (he says)... !
12:50:01r-kuquite possibly some funcs wont be wrapped yes
12:50:11r-kuservices are not difficult at all actually
12:50:13*vendethiel quit (Ping timeout: 264 seconds)
12:50:18r-kujust bit different entry point
12:50:34r-kuand installing procedure, but it depends if you do it yourself in code or use command line utils
12:51:04coffeepotI'd probably have command line to install/uninstall
12:51:41r-kueven less coding then :)
12:52:11coffeepotjust looking at what's required in C/C++, doesn't look too bad. I suppose the main thing is the structure of the wrapper to make it nice to use
12:53:49*vendethiel joined #nim
13:02:55*yglukhov__ joined #nim
13:05:18*taesoo joined #nim
13:06:36*yglukhov_ quit (Ping timeout: 276 seconds)
13:15:52*vendethiel quit (Ping timeout: 252 seconds)
13:21:56*zaquest joined #nim
13:26:17*ono is now known as OnO
13:28:41*ingsoc quit (Quit: Leaving.)
13:31:55*darkf quit (Quit: Leaving)
13:37:15*intra joined #nim
13:46:48*BlaXpirit_ joined #nim
13:46:48*BlaXpirit quit (Killed (cameron.freenode.net (Nickname regained by services)))
13:46:48*BlaXpirit_ is now known as BlaXpirit
13:47:58*OnO is now known as ono
13:48:57*ono quit (Quit: My iMac has gone to sleep. ZZZzzz…)
13:50:49*yglukhov__ quit (Remote host closed the connection)
13:51:25*yglukhov__ joined #nim
13:54:58*OnO joined #nim
13:55:44*taesoo quit (Ping timeout: 272 seconds)
13:58:42*vendethiel joined #nim
13:59:30*pregressive joined #nim
14:18:01vikatondoes rand work now?
14:24:07def-vikaton: when did it not work?
14:24:46vikatondef-, I think i needed to import a lib from nimble
14:24:56def-import math
14:25:26vikatonBlaXpirit had a rand lib
14:28:38def-that seems to work for me
14:32:41vikatonmath.random(4.0)
14:32:47vikatongives the same number
14:33:15Xaseronvikaton: have you called randomize() before?
14:34:26vikatonok
14:34:31*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:40:42*yymoto2 joined #nim
14:41:31*taesoo joined #nim
14:45:10dtscodedom96: Ping
14:45:14*vendethiel quit (Ping timeout: 245 seconds)
14:45:16dom96dtscode: sup
14:45:55dtscodeDo you still want me to report the bug even though filwit made a fix?
14:52:04*vendethiel joined #nim
14:52:04dom96dtscode: nope
14:53:35*yymoto2 quit (Quit: leaving)
14:53:55dtscodeYay. Less work for me
14:55:45*yglukhov__ quit (Ping timeout: 256 seconds)
14:59:33*Perelandric joined #nim
15:10:20*bluenote_ joined #nim
15:13:30*vendethiel quit (Ping timeout: 265 seconds)
15:15:16*vendethiel joined #nim
15:20:58*gsingh93_ joined #nim
15:29:29*gokr quit (Quit: Leaving.)
15:37:41*vendethiel quit (Ping timeout: 256 seconds)
15:44:17*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
15:51:52*taesoo quit (Ping timeout: 255 seconds)
15:59:06*milosn quit (Quit: leaving)
16:00:14*xender left #nim ("WeeChat 1.0")
16:08:05*Ven joined #nim
16:09:03*gokr_ joined #nim
16:09:55*gokr joined #nim
16:10:32*vikaton quit ()
16:12:54*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:13:08*xificurC quit (Quit: WeeChat 1.1.1)
16:24:25*endragor quit (Ping timeout: 264 seconds)
16:25:25*OnO joined #nim
16:26:17*synthmeat quit (Quit: WeeChat 1.3-dev)
16:28:16*synthmeat joined #nim
16:37:02*endragor joined #nim
16:44:23bluenote_dom96: by the way, at first I had exactly the same concern like you regarding none/some, i.e., I was favoring a symmetric function signature
16:44:40bluenote_but the assymmetric function signature leads to more symmetry on call site
16:44:46bluenote_so I changed my mind
16:45:51bluenote_I now have code where I have e.g. `shader: Shader` and it looks pretty nice to have `some(shader)` or `none(Shader)`
16:46:47bluenote_do I understand you correctly: using typedesc as a parameter is not discouraged per se?
16:50:20*filwit quit (Quit: Leaving)
16:51:29*vendethiel joined #nim
16:53:27dom96bluenote_: no idea
16:53:37dom96Araq needs to clarify.
16:54:15*jbomo joined #nim
16:55:15bluenote_ok, than I just might have read too much into your comment
16:55:37*keypusher quit (Remote host closed the connection)
16:56:06*keypusher joined #nim
16:56:28*xyz_ joined #nim
16:58:14*Ven is now known as Guest24686
17:00:18*gokr quit (Quit: Leaving.)
17:00:49*Guest24686 is now known as Ven_
17:07:02*brson joined #nim
17:11:45*endragor quit (Remote host closed the connection)
17:13:28*vendethiel quit (Ping timeout: 252 seconds)
17:18:16*vendethiel joined #nim
17:20:34*Jesin quit (Quit: Leaving)
17:24:26*Jesin joined #nim
17:34:12*ddl_smurf quit (Quit: ddl_smurf)
17:34:50*gsingh93_ quit (Ping timeout: 256 seconds)
17:37:02*taesoo joined #nim
17:41:53*vendethiel quit (Ping timeout: 264 seconds)
17:43:45*vendethiel joined #nim
17:46:54*gokr_ quit (Ping timeout: 245 seconds)
17:53:25*Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:55:20*milosn joined #nim
17:57:25*gokr_ joined #nim
18:02:04*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:34*vendethiel quit (Ping timeout: 265 seconds)
18:09:15*zahary joined #nim
18:12:31*filcuc joined #nim
18:16:54*NhanH quit ()
18:17:03*NhanH joined #nim
18:23:36*xyz_ quit (Quit: Konversation terminated!)
18:25:58*vendethiel joined #nim
18:26:41*filcuc quit (Ping timeout: 246 seconds)
18:39:01*themagician joined #nim
18:41:21*fizzbooze joined #nim
18:52:03*Climenty joined #nim
18:52:53*notfowl is now known as fowl
18:54:52*bluenote_ quit (Ping timeout: 246 seconds)
19:02:07*boydgreenfield joined #nim
19:18:04*filcuc joined #nim
19:25:14*dddddd quit (Ping timeout: 245 seconds)
19:27:55*vikaton joined #nim
19:28:10vikatonErr, is Nimble not included in the Nim tarball?
19:34:25BlaXpiritnnope
19:35:01ldleworkhi BlaXpirit
19:35:06BlaXpirithi
19:49:10*boydgreenfield quit (Quit: boydgreenfield)
19:49:35*fizzbooze quit (Ping timeout: 276 seconds)
19:56:34*boydgreenfield joined #nim
20:03:12*flaviu quit (Read error: Connection reset by peer)
20:04:09vikatonBlaXpirit: How can I get nimble then?
20:04:28def-Windows download here: https://github.com/nim-lang/nimble/releases
20:04:33def-Instructions here: https://github.com/nim-lang/nimble
20:04:45vikatonfor Linux
20:05:08dtscodehttps://github.com/nim-lang/nimble
20:05:17vikatonthanks both of u
20:07:03vikatonshould I then add .nimble/bin to my PATH ?
20:07:41def-yes
20:07:59def-then all binary packages you install with nimble will be available automatically (and nimble itself)
20:08:57vikatonthanks
20:09:48def-It would probably be nicer if nimble came bundled with nim
20:10:52ldleworkor if we had packages for the popular distros
20:13:19pigmejdef-: I'm not sure if package manager should be bundled with language
20:14:12def-pigmej: everywhere I installed nim I also installed nimble. would be more convenient for me
20:14:26pigmejdef-: yeah, but what about weird python situation ?
20:14:48pigmejwhere once you had 3 competiting 'managers' + default one which was not used at most scenarios
20:14:56ldlework3?
20:15:15def-our community isn't that big. we should improve nimble instead of starting our own managers
20:15:18pigmejldlework: probably even more... there was a time when there was a fork of fork which was a fork
20:15:31dtscodeI was going to make a repo for ubuntu for nimble and nim
20:15:31ldleworkIf I remember setuptools, got forked into distutils (which was eventually merged) which was then forked to distribute (which was eventually merged)
20:15:37ldleworkIt sounds exactly how it should work
20:15:48ldleworkthe community extends standard features until they are incorporated first class
20:15:53pigmejldlework: what about distutils2 ?
20:16:07ldleworkRight, that would be the next step
20:16:13ldleworkthere will always be community extension
20:16:28pigmejldlework: my point was that this python situation was quite weird
20:16:48pigmejwhere one 'idea' was having compatibility layer with other 'just because'
20:16:51ldleworkpigmej: Right, I don't know why it is supposed to be wierd and not 'exactly what you want'
20:16:51pigmejetc
20:17:00ldleworkpigmej: to support migration of production systems?
20:17:06fowlWe don't have competing package managers though, nimble is supported in the compiler
20:17:06ldleworkIE backwards compatible
20:17:10pigmejldlework: sure, but look from other way
20:17:23ldleworkpigmej: I think you're being dramatic
20:17:34pigmejwell, for me python2 vs python3 is dramatic ;-)
20:17:42ldleworkSure but that's entirely irrelevant
20:18:25pigmejldlework: yeah this one, but ...
20:19:34ekarlsonimble is meh...
20:19:40ekarlsoget me a regsitry -,,-
20:19:40vikatonnimble is nice
20:19:45ClimentyIt is really nice, that "nimbled" packages in my home directory automatically picks by compiler.
20:19:47ekarlsothen it's more fun :)
20:19:58def-ekarlso: what's a registry?
20:20:20ekarlsodef-: uhm, something like I started on def- like crates.io for nim
20:20:22pigmejI mean... for me, nimble should be separated (in the same way as pip is not included with python, same as hex is not a part of elixir, rebar3 is not a part of erlang etc)
20:20:52ClimentyAnd nimble is just one file.
20:21:17ldleworkekarlso: that's just a web-frontend to Cargo
20:21:31ekarlsoldlework: uh, it's more like pypi actually :)
20:21:51ldleworkthat's ... what I'm saying?
20:21:54*vikaton quit ()
20:21:55jackvhttps://aur.archlinux.org/packages/nimble-git/
20:21:57ekarlsoldlework: yeh ;p
20:22:01ldleworkekarlso: ...?
20:22:02jackvwhy I love arch
20:22:14ekarlsoldlework: I allmost had registry support done in nimble btw :)
20:22:27ekarlsowould allow you to push new versions via a REST api etc
20:22:42ldleworkekarlso: ah you're saying a service instead of a file inside of a git repo
20:22:49ekarlsoldlework: yeah..
20:22:56ekarlsothat's what crates.io is..
20:23:10ldleworkekarlso: I just remembered that all nimble uses is a flat file
20:23:13fowlekarlso: that would be great
20:23:44ekarlsohttps://github.com/ekarlso/nimble/tree/registry < has some of it
20:24:05ekarlsoand https://github.com/ekarlso/nim-packages
20:24:24*Matthias247 joined #nim
20:36:55gokr_idiotic question: what are the advantages compared to single file?
20:37:14dtscodeadvantages of what?
20:37:29pigmejgokr_: what if there will be a lot of packages ?
20:37:43fowlgokr_: merging PRs is not fun
20:38:27fowlThere's an open PR that I didn't merge yet because I have to do it manually
20:38:36fowlWell. I didn't check if its still open today
20:51:20pigmejekarlso: that registry looks quite cool ;)
20:54:52*filcuc_ joined #nim
20:55:13*filcuc quit (Ping timeout: 265 seconds)
20:55:41*Kingsquee joined #nim
20:56:32ekarlsogokr_: programmatic access? easier to publish libraries ?
20:57:25ekarlsogokr_: if you have libraries you could set it up so that when you push a release tag CI builds / tests it and has nimble autopublish it to the registry
20:59:49*taesoo quit (Ping timeout: 264 seconds)
21:07:32*intra quit (Ping timeout: 272 seconds)
21:10:53*n1ftyn8 quit ()
21:11:04*n1ftyn8 joined #nim
21:14:25*vikaton joined #nim
21:22:05*Matthias247 quit (Read error: Connection reset by peer)
21:22:13*filcuc_ quit (Ping timeout: 256 seconds)
21:23:10*gokr joined #nim
21:33:24gokrekarlso: Just for the record - I know quite a bit about package managers - since I wrote the first one for Squeak - SqueakMap.
21:33:56*Mat4-coding joined #nim
21:33:58Mat4-codinghello
21:34:00*Matthias247 joined #nim
21:34:24gokrThe idea with SqueakMap was to have the full "map" in a Smalltalk domain model inside your image. So that you could query it using Smalltalk.
21:35:16gokrSo the single master copy is hosted on a server - and it has a web UI to modify it. The map has much more than packages though, it also has accounts, co-maintained packages, releases etc etc
21:36:08gokrBut the nice thing with SqueakMap was the fact that the whole map is downloaded in a serialized form and then deserialized into the Smalltalk image.
21:36:40Mat4-codingso this is some kind of compression
21:37:15*BlaXpirit left #nim ("Quit Konversation")
21:37:45*banister joined #nim
21:38:45gokrBut it was a fairly complex piece of code, and I like the simplicity of nimble. Instead of making an advanced web UI to manipulate some database - and then spend a lot of time making a REST ful API to query it etc... I would perhaps experiment with a "federated" model instead. So why not have a "master list" of URLs, like now in git. Each URL points to a partial JSON file with packages, and has a person associated with that URL.
21:39:23gokrJust a thought.
21:42:16dom96gokr: You mean a master list of URLs pointing to different packages.json files?
21:42:24gokrYeah
21:42:31dom96others have suggested that as well
21:42:43dom96it's a nice idea
21:42:55gokrSo one main use case for that: Public repo and "company wide" repo and even "personal repo".
21:43:53gokrOne thing I like with Nimble compared to many other systems - is that its dead simple.
21:44:05dom96It will be more difficult to control package name conflicts that way though.
21:44:40ZZZZZZZZZrequire some prefix per creator or something
21:44:43dom96gokr: I'm glad you like it.
21:45:30gokrI do. I also like Lunar Linux with its similarly dead simple system with metadata textfiles in a directory tree.
21:45:55gokrI really should help out with it.
21:47:09gokrRegarding package name conflicts - I would just make sure that nimble can use some kind of "prefix" when a duplicate name is discovered.
21:48:13gokrBtw, one thing SqueakMap did was to actually cache the contents of the actual package URL on the SqueakMap server.
21:48:18ZZZZZZZZZit would be consitant with the import syntax in nim
21:48:24ZZZZZZZZZconsitatn
21:48:27ZZZZZZZZZ*
21:48:40gokrSo when some package after a year or so - falls off the internet - then the SqueakMap server would have a backup copy.
21:50:03*intra joined #nim
21:50:27*BlaXpirit joined #nim
21:54:26gokrdom96: Is there some support in nimble for... having a "per project" env?
21:54:44gokrYou know like... bundler or what the heck its called in Ruby.
21:54:53*boop is now known as boopisaway
21:55:46dom96gokr: Could you elaborate a bit on what you mean by that?
21:56:02gokrI wouldn't create a separate tool for it - just make nimble be able to a) have different "homes" and b) take some list of packages to install/update
21:56:56gokrSo with bundler you basically have your ruby project - and in that dir you have a file where you list all your dependencies that this projects wants. And then you run bundler some-command and it sucks it all down - but... just for that project - not globally.
21:57:00gokrIIRC
21:57:11gokrSome Ruby fella can probably put me straight.
21:57:57fowlGokr Bundler is used like that because gem can't support multiple versions of the same package installed
21:58:10dom96I don't think this is really needed for nimble.
21:58:15gokrMmm, good point
21:59:14*gsingh93_ joined #nim
21:59:25dom96After looking at Rust's Cargo, I think it may be a good idea to implement a dependency locking mechanism.
22:05:00gokrI would also consider adding say .. email to the package metadata
22:05:22dom96That's part of the author metadata.
22:05:28gokrHum...
22:05:31dom96But I need to document that
22:07:30*endou_________ quit ()
22:07:44*endou_________ joined #nim
22:08:52*pregressive quit (Remote host closed the connection)
22:08:53*vendethiel quit (Ping timeout: 264 seconds)
22:08:59gokrOk, so... yes, its in the nimble file - but not in packages.json
22:09:07gokrThe author I mean
22:09:58gokrSo author can be like "Göran Krampe <[email protected]>" I suppose?
22:14:45dom96yes
22:17:05*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:20:07vikatonwhats wrong with this C FFI?
22:20:15vikatonhttps://www.irccloud.com/pastebin/XuD1bcKS
22:21:43fowlvikaton, array and x params are both int32 proc itoa(f: char, array, x: int32)
22:22:05fowlplus array is probably a reserved identifier
22:22:47vikatonfowl, I get test.nim(7, 13) Error: expression 'itoa('A', x, 2)' has no type (or is ambiguous)
22:22:57vikatonafter I fix the array param that i did by accident
22:23:00fowlthat is also true
22:23:02fowlit doesnt return anything
22:23:52reactormonkvikaton, why the varargs?
22:24:05vikatonreactormonk: Its on the front page of Nim
22:24:25reactormonkvikaton, yes, but that's for scanf.
22:24:40reactormonkvarargs does exactly what you expect it to do.
22:25:41*Trustable quit (Remote host closed the connection)
22:25:50reactormonkvikaton, the signature you want is proc (input: int, str: cstring, radix: int)
22:26:05reactormonkwithout the varargs pargma, but with the rest
22:26:14reactormonkno need for int32 IIRC
22:26:52fowlint might by 8 bytes
22:27:22reactormonkdon't hold me on the int32, not sure about that one
22:27:24vikatonstill get a ambigious type error
22:27:34reactormonkcode plz
22:27:46fowlvikaton, if you have a function that doesnt return anything, how can you set its return value (nothing) to a variable
22:28:34vikatonohh i forgot
22:29:19reactormonkvikaton, so it works?
22:29:47vikatonalmost
22:29:48*Mat4-coding quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:29:49vikatoncode:
22:29:51vikatonhttps://www.irccloud.com/pastebin/zn9Tv4jk
22:31:10dom96remove the = at the end of the first line
22:31:20*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:31:51vikatonfinally worked
22:31:59vikatonthanks dom96, reactormonk and fowl :P
22:32:03vikatonhad to chnage echo too
22:32:45fowlthose ints should be "cint"
22:32:57fowlthats "c's int"
22:36:45*Sembei joined #nim
22:37:55gokrdom96: So nimble does read ~/.config/nimble/nimble.ini - if I have it. It could also check in $PWD ... or git toplevel. That would create "per project nimble", right?
22:38:59dom96gokr: not really. It would need to look for ~/.nimble/ in your $PWD
22:39:11dom96I don't understand why you would want that though.
22:39:26gokrthe idea being that I can have a fully local "nimble" in a project
22:41:09*Deesleexia joined #nim
22:46:36*TEttinger quit (Ping timeout: 258 seconds)
22:47:32dom96gokr: why would you want that?
22:47:36def-gokr: that's the hack Haskell's package manager uses because of dependency hell. do we really need that?
22:48:04gokrTo me it seems fairly reasonable to be able to have a fully isolated project environment.
22:48:06*BlaXpirit quit (Quit: Quit Konversation)
22:48:30gokrBut sure, I can use docker or whatever to achieve it
22:48:38def-gokr: in that case I would just manually add the libraries I depend on and add their local paths to a nim.cfg
22:49:26*Deesleexia left #nim (#nim)
22:49:47gokrFor example, I just read that nim will only use the latest version when compiling.
22:50:05gokrSo if one project needs an older version of package X - it gets complicated.
22:50:10gokrOr?
22:52:06gokrUsing Smalltalk I really appreciate the fact that I can have a fully isolated env in a directory. Things doesn't break because I update some library in another project.
22:52:39ClimentyOr you can put the project somewhere and create symlink to home .nimble. And change symlinks for different projects. Just weird idea :)
22:53:22gokrOk, time to sleep. Fun codebase though, I like reading it
22:55:16dom96I think most people don't realise that Nimble sorts about the dependencies for you.
22:55:27dom96s/about/out/
22:57:48gokrI do
22:58:18gokrBut as I said - your doc says nim will only use the latest when compiling.
23:05:49*BitPuffin|osx joined #nim
23:07:53fowlthe isolation can be nice
23:08:06dom96nim will
23:08:14dom96doesn't mean you have to use nim
23:09:54*Matthias247 quit (Read error: Connection reset by peer)
23:11:31*zahary quit (Ping timeout: 265 seconds)
23:15:25*sdw_ joined #nim
23:18:09*sdw quit (Ping timeout: 250 seconds)
23:25:34fowldom96, oh you mean nimble emits --path".." for each used package?
23:25:43dom96yes
23:26:40fowlit may be useful to have an isolate command that makes a nim.cfg for the packages isolated. not sure its really necessary though because bundler wouldn't exist if rubygems worked with multiple packages