<< 21-02-2017 >>

00:00:07Araqsorry, read what I just said, range of uint8 would have the same problem as uint8
00:00:14raussJust wondering. At this point it's curiosity and not trying to change anything
00:00:23raussokay, my bad
00:05:10*Matthias247 quit (Read error: Connection reset by peer)
00:17:57*yglukhov joined #nim
00:18:28*IRCFrEAK joined #nim
00:18:29*IRCFrEAK left #nim (#nim)
00:21:58*yglukhov quit (Ping timeout: 240 seconds)
00:32:14*zachcarter joined #nim
00:32:24zachcartercan someone help me re-write this c++ statement in nim?
00:32:31zachcarterauto &textureHandle = *(bgfx::TextureHandle *) cmd->texture.ptr;
00:32:42zachcarterI imagine it would be something like :
00:33:13zachcartervar textureHandle = cast[ptr bgfx.TextureHandle](cmd.texture.`ptr`)[]
00:33:14zachcarter?
00:33:40ftsfvar textureHandle = cast[ptr TextureHandle](cmd.texture.`ptr`) ?
00:34:08*onionhammer quit (Ping timeout: 245 seconds)
00:34:10zachcarterI think the thing is dereferenced
00:34:15zachcarterthus the [] at the end
00:34:18ftsfahh
00:34:24ftsfyeah
00:34:26zachcarterokay I just wanted a sanity check thank you
00:34:31ftsfwell, does it work? =)
00:34:33zachcarterno
00:34:51zachcarterwell it compiles
00:34:58zachcarterand that may not be where my problem lies
00:35:05zachcarterbut this is what I”m seeing in my bgfx nuklear code -
00:35:26zachcarterhttp://imgur.com/a/U4BzB
00:35:35zachcarterthis is what I see with my glfw3 / opengl3 test -
00:35:52zachcarterhttp://imgur.com/a/hydHN
00:36:29FromGitter<Varriount> `vra textureHandle = castbgfx.TextureHandle (cmd.texture.ptr);`
00:36:32FromGitter<Varriount> *var
00:37:02FromGitter<Varriount> Although I'm not completely sure.
00:37:23ftsflooks like fromgitter is eating some punctuation
00:37:36zachcarteryeah
00:37:37FromGitter<Varriount> `auto &textureHandle =` assigns to the memory pointed to by textureHandle?
00:37:50zachcarteryeah it creates a reference not a copy
00:37:51zachcarterI believe
00:38:10zachcarterI was confused by that too
00:40:22zachcarternot sure how to account for that
00:44:44ftsfnot sure you need to
00:46:07zachcarterhrm
00:50:20*ftsf quit (Ping timeout: 259 seconds)
00:55:40*ftsf joined #nim
01:16:51*PMunch quit (Quit: leaving)
01:17:09*libman left #nim (#nim)
01:27:20FromGitter<Varriount> zachcarter: Unfortunately I'm not too experienced with references. I know enough to use them in function parameters when appropriate, that's it.
01:28:16FromGitter<Varriount> I've no idea what the mechanics are when you assign to a reference a value returned from a function.
01:37:53ftsfit's not a function in this case
01:38:07ftsfit's a structure member
01:46:07FromGitter<Varriount> Hm. Then, would the reference be a pointer to the structure member?
01:46:52FromGitter<Varriount> References are supposed to act like aliases in C and C++, so assigning to a reference would change the structures' memory
02:10:05zachcarteryeah I’m not sure
02:10:37zachcarterI do *think* the cast and assignment is working - as if I repr the result I get the correct bgfx data structure with the right value in the right field
02:10:55zachcarterso I’m guessing my problem lies elsewhere regarding why everything is drawing white
02:13:06def-pri-pubzachcarter: thank you for doing the nuklear bindings
02:13:15zachcarterno problem
02:13:41zachcarteris your blog 16bpp.net?
02:13:42def-pri-pubI was thinking about doin them myself, but I've recently accepted a new job so I felt as I wouldn't be able to dedicate enough time to making them nice.
02:13:49def-pri-pubYup, that's mine.
02:13:55zachcarterah cool :) thanks for the star
02:14:12def-pri-pubAre you planning on working on a Nim-Friendly API?
02:14:36zachcartersomeone else asked me that earlier, sounds like there is some desire for it
02:14:47zachcarterit’s something I could potentially do
02:14:55zachcarterright now my focus is on getting a backend working with nim-bgfx for my game engine
02:14:55def-pri-pubYeah, it really sucks right now to have to manually add in the casts for datatypes
02:15:08zachcarterah that should be fixed now I believe
02:15:13zachcarterI think I removed all the nk data types
02:15:14def-pri-puborly
02:15:21zachcartermost of them anyway
02:15:28zachcarterthey should be replaced with nim-friendly types now
02:15:36zachcarterlet me make sure I committed that
02:15:55def-pri-pubWere you able to bind all of the funcitons or at least get a list of what needs bound? I asked the nuklear people if they had a list or some docs and they told me they didn't.
02:16:06*vlad1777d quit (Quit: Leaving)
02:16:11zachcartereverything is bound except for the user data stuff
02:16:13zachcarterI still need to add in that
02:16:28def-pri-pubI'd be intersted in helping, but it sucks that Nuklear doesn't have all of its stuff doc'd.
02:16:34zachcarteryeah there should be no more nk_ specific ints floats etc
02:16:48zachcarteryeah, it could definitely use some docu
02:17:32def-pri-pubHave you been able to test custom skinning? Or porting over some of the examples? I wouldn't mind helping out.
02:18:09zachcarterI haven’t yet but I imagine I will be in the not too distant future, if you want to contribute examples that would be great, I’ve only partially ported over one
02:20:03def-pri-pubAlso a suggestion: drop the `nk_` part from the identifiers. Have people include/import it as `import nuklear as nk`. `nk.rgb` looks cleaner than `nk_rgb`
02:20:28zachcarterah yeah that’s a good idea I’ll do that thank you for the suggestion
02:20:37zachcartermuch cleaner I like it a lot
02:21:17def-pri-pubI'll put an issue in the tracker for you.
02:22:22zachcarterthank you!
02:22:59*Redfoxmoon left #nim ("Leaving")
02:24:30def-pri-pubalso, the `this test` link in the README is broken
02:24:56zachcarterwhoops let me fix that thanks
02:25:00zachcarterdo that right now
02:25:39zachcartershould be fixed now
02:25:48zachcartererr maybe not?
02:26:07zachcarterit works for me
02:26:52def-pri-pubit works
02:28:46zachcartercool thanks
02:29:11zachcarterI wished my bgfx backend worked :P
02:29:21zachcartergetting there though… no longer is everything all white
02:31:00def-pri-pubI'd focus on one backend for now. GLFW seems fine (though there are two GLFW bindings for Nim in the wild). Binding the Nuklear functions is more important right now.
02:31:23zachcarterah glfw is just for windowing code
02:31:27zachcarteropengl3 would be the backend for that example
02:31:44zachcarterI’m using https://github.com/Halsys/nim-bgfx for my game engine
02:31:49zachcarterwhich is why I need the bgfx backend
02:41:20*chemist69 quit (Ping timeout: 255 seconds)
02:54:57*chemist69 joined #nim
02:58:31*rauss quit (Quit: WeeChat 1.7)
02:59:40*rauss joined #nim
03:55:08shashlickhas anyone wrapped the windows GUI api for Nim?
03:55:39shashlickI don't have VCC to build libui, and the mingw build wants GTK which won't be native
04:06:00FromGitter<vegansk> @shashlick, try libiup, it uses native interface on windows. Here is the example (https://github.com/vegansk/nimtests/blob/master/stdlib/iup/tutorial/ex3_4.nim) from official tutorial (http://webserver2.tecgraf.puc-rio.br/iup/en/tutorial/tutorial3.html#Custom_Dialogs)
04:12:21shashlickvegansk: thank you, I'll check it out
04:12:41*roygbiv joined #nim
04:23:43FromGitter<HeadClot> Hey everyone
04:25:31FromGitter<Varriount> Hi @HeadClot
04:26:44FromGitter<HeadClot> o/
04:26:52FromGitter<HeadClot> So what is nim?
04:42:56shashlickvegansk: should I use the iup bundled with Nim or the nimble package?
04:45:40FromGitter<vegansk> @shashlick, I used the bundled version
05:20:41*def-pri-pub quit (Quit: leaving)
05:45:52FromGitter<Varriount> @HeadClot It's a programming language.
06:10:54*nsf joined #nim
06:22:42FromGitter<vegansk> @Araq, how can I set the real symbol owner in this line (https://github.com/nim-lang/Nim/blob/devel/compiler/vm.nim#L1447)? For now it's just sets the package as the owner, and that condition fails (https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L33).
06:35:04*yglukhov joined #nim
06:45:24*rauss quit (Quit: WeeChat 1.7)
06:52:58*bjz joined #nim
07:01:10*rokups joined #nim
07:18:45*synshroud quit (Quit: ZNC 1.6.4 - http://znc.in)
07:21:40*synshroud joined #nim
07:22:50*ftsf quit (Remote host closed the connection)
07:27:59*dyce quit (Ping timeout: 264 seconds)
07:47:13*arnetheduck joined #nim
07:49:14*Arrrr joined #nim
07:49:14*Arrrr quit (Changing host)
07:49:14*Arrrr joined #nim
07:51:46*bjz_ joined #nim
07:53:09*bjz quit (Ping timeout: 260 seconds)
07:53:43*gokr joined #nim
08:00:48*byte512 quit (Ping timeout: 240 seconds)
08:23:16*peted quit (Quit: WeeChat 1.4)
08:23:39*peted joined #nim
08:38:25*gokr quit (Ping timeout: 260 seconds)
08:40:42*Princess17b29a quit (Quit: Princess17b29a)
08:44:13rokupssuppose a foreign thread calls into nim code. would that be a problem for say gc? for example if OS api takes callback and invokes it in other thread, or if nim is used for making inline hooks into running application code.
08:45:02zevlghey, is it possible to get sizeof external structures at compile time? Here is the problematic code - https://gist.github.com/93e86da78362c0e8735b1fb739f89967
08:46:21zevlgCan I force sizeof(Elf32_Chdr) just to emit `sizeof(Elf32_Chdr)' C code ?
08:49:34FromGitter<vegansk> @rookups, that's why we have ``setupForeignThreadGc`` and ``tearDownForeignThreadGc``
08:53:07*abeaumont joined #nim
08:54:04FromGitter<endragor> @zevlg it emits `sizeof(Elf32_Chdr)` for your first case. What you put into `const` variables, or use in static context in general, has to be known *before* C code is generated, at compile time. And it cannot be known, unless you replicate the struct in Nim.
08:56:01zevlgendragor: thanks for the explanation, but what a pity :(
08:57:18zevlgendragor: wait a second, I can just change const to var!
08:57:29zevlggreat
09:00:09*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:02:13*arnetheduck quit (Ping timeout: 260 seconds)
09:05:30*bjz joined #nim
09:09:47rokupsvegansk i suspect it would not work that good
09:10:20*bjz_ joined #nim
09:10:35*bjz quit (Ping timeout: 255 seconds)
09:17:38*rosshadden quit (Ping timeout: 258 seconds)
09:18:47*rosshadden joined #nim
09:18:51FromGitter<vegansk> @rokups , why?
09:20:28rokupshmm idk, well maybe it would work
09:20:56*yglukhov quit (Remote host closed the connection)
09:24:55rokupsah i think in this case most suitable thing would be using {.gcsafe.}
09:28:30*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:30:14*abeaumont quit (Ping timeout: 268 seconds)
09:34:05*bjz joined #nim
09:35:12*aziz joined #nim
09:40:41*Vladar joined #nim
09:41:20*bjz_ joined #nim
09:42:01*yglukhov joined #nim
09:43:17*bjz quit (Ping timeout: 260 seconds)
09:45:37*abeaumont joined #nim
10:01:38*xet7 joined #nim
10:14:45*roygbiv left #nim ("™")
10:15:43*bjz joined #nim
10:15:55*bjz_ quit (Ping timeout: 260 seconds)
10:25:23cnclif i use a set[mytype] where mytype is an enum with {.size: sizeof(cint).}, if i pass this set to an imported c procedure, it will work as i expect it to with c bitwise flags, correct?
10:25:46cncli butchered that sentence, sorry
10:44:19*synshroud quit (Quit: ZNC 1.6.4 - http://znc.in)
10:45:51*synshroud joined #nim
11:14:59*couven92 joined #nim
11:34:13*PMunch joined #nim
11:44:10*yglukhov quit (Remote host closed the connection)
11:44:29*chemist69 quit (Ping timeout: 255 seconds)
11:47:13*chemist69 joined #nim
11:49:48*arnetheduck joined #nim
11:57:09*yglukhov joined #nim
12:22:06*planhths joined #nim
12:38:55*vlad1777d joined #nim
12:40:56*Guest67605 joined #nim
12:41:13*Guest67605 left #nim (#nim)
12:45:21*chemist69 quit (Ping timeout: 240 seconds)
12:48:28*gokr joined #nim
12:48:48*aziz quit (Quit: Ex-Chat)
12:49:56Araqcncl: that's exactly *not* how it works
12:54:55cncloh, ok. how does it work?
12:56:54*krux02 joined #nim
13:03:42Araqsets make the compiler transform 'val' into '1 << val'
13:03:54*chemist69 joined #nim
13:04:18cnclyeah, i already compensated for that
13:04:28*zachcarter quit (Quit: zachcarter)
13:04:54Araqoh ok, then it has a chance of working
13:04:57cncloriginal c lib definitions used left shifts, i just removed the 1 and left the shift offset values for the nim enum definition
13:05:51cnclthere aren't any gaps, it just goes from 0 to 12
13:06:03Araqok then
13:07:30cnclwill the sizeof the set[...] be the same?
13:08:05cnclit actually seems to work when i tried it, but i don't know if that is going to be generally true
13:08:40Araqthe size of the set is 2 bytes though, not cint
13:08:53Araqworks because of little endian machine, I assume
13:09:36cnclah i was worried about that
13:10:02cnclwhat determines the size of the set? the highest possible valid flag bit?
13:15:45Araqyes
13:16:18AraqdummyValue = 30 at the end of the enum would make it compatible or a .size annotation
13:16:39cncloh, it accepts .size?
13:16:45*Vladar quit (Quit: Leaving)
13:16:58cncli'll do that, then, unless you think it's a bad idea
13:19:46*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:35:24Araqbetter use the dummyValue solution for now
13:39:36*rupil joined #nim
13:46:54cnclok
13:47:38cncli didn't want to give it a converter for cint because there are other flags in this library with similar ways which can be combined in confusing ways (nanovg)
13:47:58cncler, other flags with similar names but incompatible usages
13:51:04*zachcarter joined #nim
14:00:32AraqI never use converters
14:04:08cnclthey're also used pretty frequently so i didn't want to make people use explicit cast all of the time
14:07:25*xet7 quit (Ping timeout: 260 seconds)
14:07:48*Vladar joined #nim
14:27:11rokupsAraq: im done with all the things i wanted with coroutines. if noone finds any problems it should be ok to merge. now you can guide me how to add support for overriding c++ virtual methods ;)
14:29:03krux02Araq: is there a reason, why I can't change the kind of a NimNode?
14:30:44krux02I am doing a lot of tree transformations, and when I could just change the kind of a NimNode, it would make things just simpler
14:39:00*couven92 quit (Quit: Client disconnecting)
14:46:54*rauss joined #nim
14:52:28Araqthat doesn't seem wise to allow
14:56:24*nsf quit (Quit: WeeChat 1.7)
15:00:37*shashlick quit (Ping timeout: 260 seconds)
15:02:39*shashlick joined #nim
15:16:56*rosshadden quit (Quit: WeeChat 1.7)
15:19:34*rosshadden joined #nim
15:23:34*byte512 joined #nim
15:34:23krux02Araq: no matter if it's wise to do so or not, it allows to actually modify the AST at will
15:34:44krux02when I want to change the kind of the node, I have to copy all children with a for loop
15:34:50krux02I can't just set the kind
15:35:03krux02I can't set the sons with result.sons = arg.sons
15:35:14krux02but don't spent to many thoughts on it
15:36:08krux02it's not severe at all
15:36:37krux02but I have currently a problem, is the a debug tool built into nim, that allows me to see the entire replacement of a macro?
15:36:59Araqecho repr result # last stmt in your macro
15:37:25krux02no that doesn't work, because I have several layers of macro calls
15:37:41krux02an untyped macro fot the outer facade
15:38:23krux02and a typed inner macro call
15:38:45krux02so the outer macro transforms my grammer into something that the nim typechecker can typecheck
15:39:13krux02it generates symbols and a correctly typed expressen
15:39:29krux02but the inner macro call then does not know the generated expressions from the outer macro
15:39:37krux02I would like to see the result of the entire thing
15:39:42krux02everything expended
15:48:05krux02Araq: got a solution: http://ix.io/nCv
15:48:34*dexterk_ joined #nim
15:49:09*dexterk quit (Ping timeout: 260 seconds)
15:49:30*yglukhov quit (Remote host closed the connection)
15:59:30*gokr quit (Ping timeout: 260 seconds)
16:06:01*stisa2 joined #nim
16:08:30stisa2krux02 there's also ``expandMacros`` https://nim-lang.org/docs/macros.html#expandMacros.m,typed
16:15:02*gangstacat quit (Quit: Ĝis)
16:30:42FromGitter<barcharcraz> a macro debugger would be a neat project
16:31:05subsetpark I've been thinking recently about building a property-based testing library for Nim
16:34:30*PMunch quit (Quit: leaving)
16:38:35*brson joined #nim
16:51:31*yglukhov joined #nim
16:55:53*yglukhov quit (Ping timeout: 260 seconds)
17:04:28*UxerUospr joined #nim
17:15:37*dexterk_ quit (Remote host closed the connection)
17:16:02*dexterk_ joined #nim
17:17:53*Trustable joined #nim
17:42:12dom96I must say, I am fairly proud of my answer here about what makes Nim special: https://news.ycombinator.com/item?id=13694686
17:52:46*nsf joined #nim
18:09:01zachcarterI need to try to convert this to nim - https://github.com/vurtun/nuklear/blob/master/nuklear.h#L988
18:09:31zachcartererr that’s no tthe right line
18:09:43zachcarterhttps://github.com/vurtun/nuklear/blob/master/nuklear.h#L994
18:10:02zachcarterhere’s an example of its use
18:10:24zachcarterhttps://github.com/vurtun/nuklear/blob/5011a36529c7da111e9ba6195074d6da8be6887f/demo/glfw_opengl3/nuklear_glfw_gl3.h#L275
18:10:49zachcarterI don’t understand how it takes in a closure
18:11:25zachcarteralso the != 0 check is confusing
18:13:03zachcarterdom96: it’s good answer
18:13:05CalinouI agree with that, dom96 :)
18:13:09Calinouby the way, hi
18:13:39zachcartero/
18:14:46krux02zachcarter, that is a macro, that expands the the loop header of a for loop
18:15:07krux02in other words the closure is not passed from the macro at all
18:15:18krux02it is expected to be written after
18:15:23zachcarterah okay
18:15:35zachcarterthat makes more sense
18:15:43krux02for example I once did a fori loop macro
18:16:33krux02#define fori(N) for(int i=0,max_i=N; i < max_i; ++i)
18:16:41*chemist69 quit (Ping timeout: 240 seconds)
18:17:22zachcartermakes sense
18:17:34krux02but that's c++ not C
18:18:50*chemist69 joined #nim
18:19:36*Matthias247 joined #nim
18:23:19*vlad1777d_ joined #nim
18:25:23dom96Thanks guys :)
18:25:29*vlad1777d quit (Ping timeout: 260 seconds)
18:31:25raussdom96: Great response!
18:33:30zachcarterkrux02: so the iterator is simple enough but what is catching me up is the comparison to 0
18:33:34zachcarterI don’t know how to emulate it
18:33:59zachcarterI guess I’m doing it in the glfw3 example
18:34:28dom96rauss: thanks :)
18:34:53*Arrrr quit (Ping timeout: 255 seconds)
18:35:05dom96Calinou: Check out my website branch when you get a chance. I made some changes.
18:35:28dom96Calinou: Would love to know what you think. Keep in mind that some of it is still in progress though.
18:35:48dom96My changes to the nav bar are the major changes.
18:36:35zachcarterokay nevermind krux02 I think my code is fine in the example
18:36:42zachcarterdon’t really need to emulate that macro
18:39:55*yglukhov joined #nim
18:40:37krux02zachcarter: you can emulate that macro with a template
18:40:54zachcarterah yeah I tried but I couldn’t figure out how to do the iterator
18:42:40*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
18:43:10krux02http://ix.io/nGp
18:43:43krux02I don't really know anything about the cmd or ctx thing
18:44:06zachcarterah thank you
18:44:07krux02I just did it literally
18:44:17zachcarterright
18:44:35zachcarterokay that’s pretty muchw hat I had I just didn’ tknow how to account for the loop body but that makes sense and works thank you
18:45:26krux02yes you can even call it with a colon and a block like a normal loop in nim
18:45:29Calinoudom96: the frontpage changes look nice, it's much nicer that the navbar blends with the jumbotron now :)
18:45:41dom96Calinou: Glad you like it :D
18:46:13dom96I'm going for a "plain and simple" look
18:46:20dom96so I removed the green bar as well.
18:46:29dom96People will surely scroll down :)
18:46:35Calinouok
18:46:53krux02I didn't even notice the difference, I guess I really are not sensitive for those things
18:47:21Calinounavbar broke on smartphones though, it's offset to the right
18:47:24CalinouI can fix that, I guess
18:47:51Calinouthe navbar gradient also scrolls down when the user scrolls down :P
18:47:57dom96Calinou: Oh yeah, I wasn't sure how to align it to the right so I did it a bit hackishly as a prototype.
18:48:14dom96Pretty sure there is a TODO in there somewhere :)
18:48:29Calinoudom96: what should I do? commit fixes to your branch, then we merge it into master?
18:49:34*krux02 quit (Remote host closed the connection)
18:50:18dom96Calinou: sure, feel free.
18:51:07dom96I was planning on adding more things to that branch but we can merge it into master now after you add your fixes.
18:51:12dom96Book got me busy again D:
18:51:23Calinoucool
18:51:31Calinouare there plans to put the book on sale again? I might buy it perhaps
18:52:51dom96No idea I'm afraid.
18:53:05dom96But I'll let you know when a sale happens
18:53:09Calinouok, thanks :)
18:54:35*dashed joined #nim
18:54:40*yglukhov quit (Remote host closed the connection)
18:58:19*GustavoLapasta joined #nim
19:16:10*jjido joined #nim
19:17:01*kunev quit (Ping timeout: 240 seconds)
19:19:44*kunev joined #nim
19:19:45subsetparkhttp://makespace.com is now running Nim in production :)
19:21:45Araqsubsetpark: that's awesome :-)
19:22:38*yglukhov joined #nim
19:24:32zachcarterI’m pretty sure my trouble with getting my bgfx backend to work with my nuklear bindings lies at my inability to convert this line of code to Nim properly : https://github.com/VladSerhiienko/FbxPipeline/blob/master/FbxPipeline/FbxViewer/NuklearSdlBgfx.cpp#L222
19:25:11*yglukhov quit (Remote host closed the connection)
19:25:28zachcarterlet textureHandle = cast[ptr TextureHandle](cmd.texture.`ptr`)[]
19:25:31zachcarteris what I’ve come up with
19:25:36zachcarterbut I’m pretty sure that’s incorrect
19:25:44*yglukhov joined #nim
19:29:58*yglukhov quit (Ping timeout: 240 seconds)
19:30:44zachcartersubsetpark: is the entire website backend written in Nim?
19:31:39subsetparkNo way! It's a Django app, but I've been rewriting our service availability logic as a Python module backed by a Nim DLL
19:32:00zachcarterah cool :D
19:33:26zachcarterkrux02 / araq : if either of you have a sec can you look at that last link I posted and tell me if my conversion looks correct? I don’t think I’m accounting for the &auto
19:33:31zachcarterand I don’t know how to do so :/
19:34:22*PMunch joined #nim
19:35:40*nsf quit (Quit: WeeChat 1.7)
19:37:00*nsf joined #nim
19:37:23Araqlet textureHandle = cast[ptr TextureHandle](cmd.texture.`ptr`)
19:38:34zachcarterI figured I needed to dereference too, okay thanks
19:52:10*rokups quit (Quit: Connection closed for inactivity)
19:52:58*krux02 joined #nim
19:58:11dyce[m]https://glot.io/snippets/encj66obji
19:58:35dyce[m]is having FirstName and LastName as their own types too extreme or a good idea?
20:00:41*jjido quit (Ping timeout: 240 seconds)
20:09:17dom96dyce[m]: maybe a tad :)
20:10:33dyce[m]dom96: heres an article i read: http://blog.jessitron.com/2012/03/strong-typing-in-java-religious.html
20:11:00dyce[m]maybe it makes sense in more complicated code bases (like what java tends to do)
20:11:25dyce[m]but i don't think anyone should be planning to make their code complicated :P
20:11:34dyce[m]but i suppose it happens over time
20:17:02stisa2well the way you wrote it is just an alias, so passing it a plain string would still work. You'd need distinct types https://nim-lang.org/docs/manual.html#types-distinct-type to make them really different
20:17:07*rosshadden quit (Ping timeout: 268 seconds)
20:17:26*rosshadden joined #nim
20:19:19dyce[m]stisa2: good point thanks
20:21:59*chemist69 quit (Ping timeout: 255 seconds)
20:25:14*chemist69 joined #nim
20:35:53*gokr joined #nim
20:41:44*smt__ is now known as smt
20:42:21*gokr quit (Ping timeout: 240 seconds)
20:47:20*brson quit (Ping timeout: 268 seconds)
20:47:22*bjz joined #nim
20:51:20*brson joined #nim
21:15:59*zachcarter quit (Ping timeout: 255 seconds)
21:27:34*yglukhov joined #nim
21:27:52Araqdyce[m]: for i18n considerations it's more likely you want a single 'name' field though
21:29:18*irrequietus joined #nim
21:32:41*yglukhov quit (Ping timeout: 240 seconds)
21:34:15*Vladar quit (Quit: Leaving)
21:35:53*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:41:39*Matthias247 quit (Read error: Connection reset by peer)
21:42:20demi-for reference dyce[m] http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
21:42:46dyce[m]Araq: that make sense, do you know what other benefits using a distinct string would have? besides accidentally swapping parameters in a procedure? i suppose it helps you catch things by compiler that you wouldn't if you just used the primitive type
21:43:00dyce[m]i was just using that as an example :)
21:45:17demi-dyce[m]: i think with the example you gave, the solution is more clarity in code intent, not necessary more explicit types
21:46:44demi-you have to draw a line at some point where programmer error occurs due to <whatever reason>, and that is something that just will happen. making more nuanced types isn't necessarily the appropriate solution to that -- as you mentioned it can cause code to be extremely over-complicated to the point where it is not manageable.
21:48:39demi-too much of any one thing is never good, and in this case i think that holds true that just because you can make more explicit types to clarify wrongful entry into a particular field, that is just generating boilerplate rather than expressing the code's intent more clearly.
21:49:30dyce[m]right
21:51:46*jh32 quit (Remote host closed the connection)
21:55:17*UxerUospr quit (Ping timeout: 240 seconds)
22:00:38Araqdyce[m]: in general yes, distinct types improve type safety and arguably also readability
22:03:21*planhths quit (Quit: Konversation terminated!)
22:04:08*kunev quit (Ping timeout: 255 seconds)
22:05:24*kunev joined #nim
22:06:27*rauss quit (Quit: WeeChat 1.7)
22:29:01*chemist69 quit (Ping timeout: 240 seconds)
22:33:42*chemist69 joined #nim
22:39:06*nsf quit (Quit: WeeChat 1.7)
22:41:38*irrequietus quit ()
22:49:30*vlad1777d_ quit (Quit: Leaving)
23:18:08*ftsf joined #nim
23:18:57*Trustable quit (Remote host closed the connection)
23:29:21*ftsf quit (Ping timeout: 240 seconds)
23:30:36*yglukhov joined #nim
23:34:55*PMunch quit (Quit: leaving)
23:35:47*yglukhov quit (Ping timeout: 240 seconds)
23:40:15*zachcarter joined #nim
23:42:04zachcarterhttp://imgur.com/a/25d9m
23:42:10zachcarterbgfx w/ nuklear in Nim :D
23:42:39*ftsf joined #nim
23:55:56*couven92 joined #nim