<< 19-07-2018 >>

00:00:47FromGitter<Quelklef> hmm
00:03:19FromGitter<Quelklef> Is Nim's philosophy on errors different from Python's
00:03:37FromGitter<Quelklef> ? I suspect that's why I feel gross about IndexError being fatal
00:04:49FromGitter<kayabaNerve> @Quelklef Probably. I didn't read the RFC; just your comment.
00:05:19FromGitter<Quelklef> @kayabaNerve That'd by why.
00:13:42*leorize joined #nim
00:15:34*yglukhov[i] joined #nim
00:17:27*xylef joined #nim
00:21:22*yglukhov[i] quit (Ping timeout: 264 seconds)
00:30:56*erblite quit (Quit: WeeChat 1.9.1)
00:38:45*donlzx joined #nim
00:54:56*stefanos82 quit (Quit: Quitting for now...)
01:22:41*chopzwei joined #nim
01:49:18zacharycarterQuelklef: you have to consider the target compilation backends / python's runtime
01:49:43zacharycarterI assume that some things that are possible with a python runtime, won't be possible with a static C compilation
01:49:49zacharycarterlike recovering from invalid memory access errors etc
01:53:07zacharycarterhttps://stackoverflow.com/questions/24513102/why-does-python-handle-a-keyerror-differently-than-an-indexerror-in-this-case - so Python handles these cases as Classes which are objects which automatically resolve to true - https://docs.python.org/2/library/stdtypes.html#truth-value-testing
01:54:03zacharycartervs - https://kb.iu.edu/d/aqsj
01:54:18zacharycarterso the answer is in Python's runtime - which Nim lacks
01:55:39zacharycarterand this boils down to python's bytecode to machine code compilation process I think
01:55:57zacharycarterthere's a chance there to handle these exceptions and do something with them
01:58:00zacharycarterAlso - please don't take anything I wrote above as truth - it's merely conjecture and answers from people who know what they're talking about should be regarded with more truth :)
01:58:51zacharycarteralthough I think the fact that you have to run a python program with python vs just being able to execute a binary, adds to my point
02:05:50*leorize quit (Ping timeout: 256 seconds)
02:06:02FromGitter<rayman22201> Nim does have a runtime.... so does C++.... C++ also has execeptions as classes.... I think you are conflating bytecode compilation with runtime environment
02:07:27*skrylar reads.
02:07:31skrylaryes, Maybe types are great.
02:08:11skrylarI think the thing i remember most about haskell (other than monads, which i never learned) is that Maybe -> Nothing | Just x is very useful; and now people are trying to bolt nullable types which are basically the same thing
02:09:06*cspar joined #nim
02:11:19FromGitter<rayman22201> > *<Araq>* sure, people are free to use them. I don't.
02:11:31FromGitter<rayman22201> lol. Araq has strong opinions about things :-P
02:12:36skrylarits hard to do a good job with weak opinions
02:13:01FromGitter<rayman22201> Agreed. I <3 this about Araq actually.
02:14:28FromGitter<rayman22201> It's an interesting point regarding whether indexError should be catchable... I'm not sure how I feel about it. From a low level systems point of view, that's a serious security issue if it happens, and the program really should trap, and just die. And if more graceful behavior is needed, the supervisor pattern Araq describes in the RFC is a very clever way to handle it.
02:15:42FromGitter<rayman22201> Although it feels like you loose some fine grained control of error handling that way. Arguably you don't need that kind of fine grained control over fatal exceptions most of the time in practice anyway.
02:19:37skrylari suppose that requires some deep introspection on whether checks that can be elided in release builds should be catchable in debug builds
02:20:20skrylaralthough there is the argument from Rust where certain errors cause controlled demolitions of the process so it can still make last ditch attempts to ex. save transaction journals
02:21:05FromGitter<rayman22201> The supervisor that Araq describes in the RFC is very similar to the Rust like "controlled demoltions" that you describe.... I think anyway
02:23:05skrylarhe's been talking about going in a rustlike direction for a couple days
02:23:26skrylarit's not the worst way to handle memory
02:23:59FromGitter<rayman22201> Steal the best parts of other languages lol! I'm all for it!
02:24:04skrylarGCs let you get away with some mind blowing and/or aggressive compiled code stuff, but the piper still has to be paid at some point (which is only an issue on small rigs)
02:24:18skrylarborrowed/unique + weak ptrs are much simpler for a runtime to implement tho
02:26:51FromGitter<gogolxdong> Is there a lib to translate python to nim?
02:27:17FromGitter<rayman22201> https://github.com/metacraft-labs/py2nim
02:27:58FromGitter<rayman22201> @skrylar I came to Nim from the desire for a less insane Rust, so I am ok with this :-)
02:28:43FromGitter<rayman22201> I think Araq has different motivations though. I have heard him mention that he is tired of fighting GC bugs. but I don't want to speak for him.
02:34:55skrylarhe said it was about trying to position for the embedded market
02:35:15skrylari guess the embedded market is more blue of an ocean than desktop systems, where everyone is basically just flopping to Go (if anything)
02:35:15FromGitter<rayman22201> I also think that is a good move as well. Nim can do really well there
02:36:09FromGitter<rayman22201> yup, exactly. I agree with this.
02:36:51*chopzwei quit (Ping timeout: 250 seconds)
02:37:44FromGitter<gogolxdong> doesn't compile.
02:38:17skrylaradventures of SOAP serialization?
02:38:20zacharycarterrayman22201: yeah - every programming language has a runtime - I was saying Nim doesn't have the same runtime as Python - there's no intermediate compliation step to bytecode
02:38:53FromGitter<rayman22201> @gogolxdong I'm afraid I've never actually used py2nim. So I can't be of much help. I have just heard it mentioned a few times. :-/ sorry
02:38:54FromGitter<gogolxdong> yes ,I 'm trying to translate vmware python SDK to nim but found overwhelming.
02:39:08zacharycarterpy2nim doesn't make any sense
02:39:12zacharycarterC2nim does
02:39:15zacharycarterP2nim does not
02:39:23zacharycarterPy2nim*
02:39:43zacharycarterhow are you going to go from a higher level abstraction to a lower one through an automated process?
02:39:45FromGitter<gogolxdong> vmware uses SOAP.
02:40:18skrylargit init irishspring
02:40:24zacharycarterSOAP is fine for server to server communication / RPC but you'd be better off with binary serialization protocol IMO
02:40:30zacharycarterif your use case is client to server - use REST or HTTP
02:40:38FromGitter<gogolxdong> its python SDK code is auto-generated too
02:40:52zacharycarterwell yeah - autogenerating soap envelopes isn't that hard
02:40:53skrylarzacharycarter, ey doesn't control the wire, it's a client lib
02:40:59zacharycarterthe thing is - not many people are using SOAP anymore
02:41:08zacharycarterah gotcha
02:41:15FromGitter<rayman22201> @zacharycarter I see. Your logic is still flawed though. The bytecode step is not why Nim handles exceptions differently
02:41:26skrylararguably saying to use REST instead of SOAP is an invalid sentence
02:41:44skrylarREST is an endpoint and command designator, it still carries a payload
02:41:48zacharycarterwell - I wasn't sure - I was just thinking it would be a place to catch an invalid memory access error
02:42:22zacharycarternot sure how Python doesn't segfault
02:42:36skrylarthe macros i wrote for flatbuffers/protobuf could probably be repurposed for SOAP, although i don't know if ex. the xml module in stdlib will handle it all
02:42:54zacharycarterREST is just a paradigm right? SOAP is a communication protocol
02:42:55zacharycartermy point is - if you're using SOAP - you're most likely using it over HTTP these days
02:42:58zacharycarterso why not just abandon it?
02:43:08skrylarbecause he doesn't control the protocol
02:43:17zacharycartergotcha
02:43:30FromGitter<rayman22201> He is trying to write VMware client. Can't change VMware
02:44:00zacharycarterugh yeah - generating SOAP clients isn't fun either
02:44:00zacharycarterlots of XML parsing
02:44:13skrylarand yes, REST is basically just using http as a payload carrier ;p
02:44:33FromGitter<rayman22201> indeed. sad pandas
02:44:44skrylarwell generating the messages is not so hard; i have done this with flatbuffers and protobuf already
02:44:54skrylarparsing depends on if you are doing sax or dom parsing
02:45:12skrylardom parsing (preload whole input to xml, get dom, then query recursively) easier but more ram intensive
02:45:19zacharycarterwell SOAP has all sorts of shit baked into it
02:45:22zacharycarterlike security etc
02:45:39zacharycarterlike - I remember trying to set up SOAP based web services for one company I worked for and I literally spent close to a month trying to figure out how to secure our SOAP web services
02:45:53zacharycarteralthough I was dealing with TIBCO business works at the time - which didn't help things- but still, it was hell
02:46:00skrylarsecuring anything is bound to be a trouble
02:46:24FromGitter<rayman22201> SOAP is a shit show. Sadly a lot of larger corporate entities still use it...
02:46:34zacharycarterdude - we've had one of our architects just randomly quoting PCI compliance shit in one of our slack channels for the past few weeks
02:46:45zacharycarternow he's advocating for installing anti virus solutions in our docker images
02:46:54FromGitter<rayman22201> hahahahaha
02:47:11skrylarwhy am i not surprised
02:47:11zacharycarterI keep saying - if you care this mucha bout PCI compliance - fucking run OpenBSD and use pledge or some other sandboxing solution
02:47:14zacharycarterdon't containerize
02:47:54zacharycarterI've never met someone before who can read the same sentence as me and interpret it in an entirely different manner
02:48:07skrylari don't think pci says anything about containerizing, but i have heard people tend to put them on separate networks
02:48:08zacharycarterhe's like - okay, we need PCI compliance - AWS says their fargate service is AWS complaint
02:48:17zacharycarterwe all go read the AWS docs about fargate being compliant - yep it's compliant!
02:48:31zacharycarterhe comes back and says well - AWS says fargate CAN be compliant
02:48:39FromGitter<rayman22201> Anyway, @gogolxdong I think you may be better off doing the port by hand. Unfortunately there is not an easy / ready made solution for you I'm sad to say
02:48:40zacharycarterand we're all like - no... it says it is
02:48:50zacharycarterso here we are discussing anti-virus solutions for containers
02:48:53zacharycarterkill me
02:49:24FromGitter<rayman22201> Have the guy call / email your AWS rep?
02:49:33FromGitter<Quelklef> @zacharycarter I think you're severely misunderstanding that SO post. The OP's code is not doing any exception handling.
02:50:25zacharycarterthat's not why I was linking the SO post
02:50:38zacharycarterI was linking it to differentiate the differences between how python is compiled / interpreted vs C
02:50:44FromGitter<gogolxdong> @rayman22201 from auto generated code by unknow method to auto generated code by macro , yes. It's sad.
02:50:53FromGitter<Quelklef> Ah
02:50:55zacharycarterI have no idea why the exceptions are managed vs unmanaged
02:51:03zacharycarterI was just guessing
02:51:05zacharycarterhttps://github.com/stoneyrh/gSOAP
02:51:13zacharycartermaybe write bindings to that gogolxdong
02:51:42FromGitter<rayman22201> @gogolxdong and @zacharycarter I was about to suggest the same
02:51:58FromGitter<rayman22201> instead of going down from Python, go up from C. Maybe easier.
02:52:08*dddddd quit (Remote host closed the connection)
02:52:44zacharycarterwell with Nim going up from C is always easier
02:52:45zacharycarterthe reverse is almost always impossible
02:52:55zacharycarteralthough it's definitely possible to invoke Python / Java from Nim
02:53:31zacharycarterI'd find a C/C++ SOAP library and bind to it with C2nim / nimgen
02:53:46zacharycarteryou can probably have a working solution in a few hours if you know what you're doing
02:53:58skrylarbribe skrylar to write it [lol]
02:54:06zacharycarterthere's that too :P
02:54:32zacharycarteror you can pay me once I quit my job in the near future and become a full time Nim developer
02:54:43zacharycarterI'm just going to pay myself somehow
02:55:21zacharycartercan't deal with these people telling me to antivirus my docker containers anymore
02:55:47FromGitter<rayman22201> I like your moxy @zacharycarter. Good for you!
02:56:12zacharycarter:P
02:56:44skrylarxml has some interesting metadata challenges admittedly
02:56:55zacharycarterit's all fake - I've been talking about a new job for at least a year now - anyone that's been around here long enough can tell you I'm a fraud :P
02:57:19skrylarlike right now i'm dealing with Ink, and they use json as a container for bytecode. but where xml has attributes and children, json has no attributes, so they have invented some demented shit in json
02:57:24zacharycarterI'm stuck in that rut of being a self-taught no CS background programmer that's now having to learn all the stuff I missed in college
02:57:29*Jesin quit (Ping timeout: 260 seconds)
02:57:35skrylaryou have to check the last entry in an array for container attributes in ink files
02:57:42zacharycartercurrently reading - https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319
02:58:05zacharycarterwhat is Ink?
02:58:29skrylarsomething you use to write on paper [https://www.inklestudios.com/ink/]
02:58:54*Jesin joined #nim
02:59:12zacharycarteroooo
02:59:12skrylarthere is also Yarn which is a port of twine to use as a dialogue engine in games, but i liked ink better, so writing a runtime for it in godot
02:59:31skrylarbut they use a stack-machine with json bytecode
02:59:51skrylarthis is one of those times you should have used XML
02:59:52zacharycarterwhen you said yarn I thought you meant facebook and I was concerned for a second
02:59:58*Jesin quit (Remote host closed the connection)
03:00:21skrylarbecause we could just have >container name="thing"> instead of [..., ..., {"n"="thing"}]
03:00:22zacharycarteryeah - people are terrible at picking the right markup language traditionally
03:00:50skrylarthey did it because you can use newton.json.dll to slurp the file
03:01:18skrylargodot also lets you do a parse_json(file.readall()) and get a traversable dict, which the xml apis don't do (even though xml is more appropriate in this case)
03:01:18zacharycarterlike I was trying to port Horde3d at one point and they had all their config in xml
03:01:36skrylartoml is okay
03:01:43zacharycarterI hate godot tbh
03:01:53skrylari actually wrote rfc3339 because thats the date format TOML uses
03:01:55zacharycarterTheir BDFL / core devs are clueless when it comes to writing a game engine
03:02:03skrylarwat
03:02:14zacharycarterdude - read this post, let me find it
03:02:20skrylartheir core devs used to ship mobile games, 2.x actually had more sanity to it than unity does
03:02:30skrylar3.x i dunno. they removed the atlas exporter :(
03:02:37zacharycarterhttps://godotengine.org/article/why-does-godot-use-servers-and-rids
03:03:00zacharycarterthis part is the best
03:03:01*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/OoNWzSTyjULgPIdvggfSdumY >
03:03:09skrylari had a minute curiosity for monogame but two years and they still have not added support for GLSL shaders on linux
03:03:17skrylar"just get a windows machine to compile your shaders" get fucked
03:03:48zacharycarterwe need to roll our own with BGFX IMO
03:04:22skrylarMeh, i plan to actually ship somethign someday
03:04:46zacharycarterwe need to port - https://github.com/nem0/LumixEngine / https://github.com/volcoma/EtherealEngine
03:04:47skrylarre-engineering things godot just does for me for no reason other than NIH doesn't appeal to me
03:05:20zacharycarterwell this is another thing i crossed paths with with the godot devs
03:05:46zacharycarter#1 question - why write your own renderer, why not use BGFX when you're going to inevitibly face the deprecation of OpenGL
03:05:51FromGitter<rayman22201> lol. It's good to dream @zacharycarter. If you like that book you might like this one, It's one of my favorites for laypeople: https://www.amazon.com/gp/product/0691158193/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
03:06:15zacharycartertheir answer - we're make our own BGFX
03:06:18zacharycarterokay! have fun!
03:06:20zacharycarterI know the creator of BGFX is one of the best C++ graphics programmers I've ever encountered
03:06:21zacharycarterbut I'm sure you guys can do better
03:06:43FromGitter<rayman22201> I stepped away for 5 minutes and lost all context.... lol
03:06:47skrylarbgfx doesn't really -do- much though
03:06:58zacharycarterrayman22201: thank you! I have a arm architecture book that's next on my list, and then I'm tackling data structures / algos
03:07:13skrylari mean its a clean lowest common denominator over GL and DX, and i gave it a spin, but it's hardly "wow i must have this in my life"
03:07:26zacharycarterwell plus metal
03:07:38zacharycarterand actually it does do a lot
03:07:45skrylari would like to see a rebol shader compiler :3 but eeh
03:08:06zacharycarterit provides a single API for interfacing with whatever graphics API is preferred for the architecture / cpu the program is running on
03:08:17zacharycarterso you don't have to write for direct x or opengl or metal or whatever
03:08:29zacharycarteryou just write for bgfx, and bgfx handles the draw calls - not to mention, in an optimized fashion
03:08:47skrylarmy mac is too old for metal iirc so .
03:08:55zacharycarteryou don't have to do draw call bucket sorting, etc
03:09:10zacharycarterbgfx is more relevant than ever with what apple just did IMO
03:09:20skrylari have a rebol lexer on hand. should probably fiddle the parser to completion as well :\
03:09:42zacharycarterin fact - I'm seeing a lot of game engine BDFLs talk to Branimir (BDFL of BGFX) and tell him he was right
03:09:53zacharycarterwhen they second guessed him in the first place
03:10:01skrylarwhy does everyone keep talking about bdfls all the sudden
03:10:08skrylarit's like guido happens and its a global meme now
03:10:17zacharycarterI think the acronym has just caught on
03:10:28zacharycarterI started using it as soon as I could associate it with Araq
03:10:29skrylarwe have been calling them maintainers for 20 years
03:10:36zacharycarterand then I would talk about Araq at work as the BDFL
03:11:13skrylaranyway yes, bgfx is nice.
03:11:16zacharycarterpeople would be like - wtf is a BDFL, and then I'd get to launch into a whole explanation about Nim and Araq
03:11:21skrylarthe reason i use godot is because it offers me the tooling
03:11:37zacharycartergodot is the best option we have - for sure atm
03:11:51zacharycarterbut I want to write a game engine in pure Nim that can compete and do better
03:11:51FromGitter<gogolxdong> SOAP serialization is not a wall, since there is gSOAP, effort would be mostly taken on mapping its auto generated python code to corresponding hierarchy object of Nim to make invoking wsdl method native in Nim.
03:12:05FromGitter<rayman22201> Have to take off for dinner. ttyl guys. I will try to be on later. @Varriount Our time zones seem to be too far off, but If you are on later, I would like to work on finishing our doc search PR.
03:12:35zacharycarterrayman22201: Varriount and I live near eachother / have met up to nerd out
03:13:00skrylarzacharycarter, game engines are always super prone to NIH syndromes. personally, i would rather see tools that were independenly useful but offered integrations
03:13:25FromGitter<rayman22201> lol. Then tell him to get on IRC :-P. OK I have to go for realz now
03:13:42zacharycarterskrylar - yeah, but I don't want to develop something for an open source project I can poke holes in / has a community that mostly consist of 12 year olds that want to make vidya games
03:13:54skrylarin 2.x there was this cool audio sample bank in godot you could trigger sounds by setting a parameter, which you can animate/set any parameter from an animation strip, so it was super easy to play sounds from the animation editor
03:14:10skrylarthe new engine makes you keep a stream object per-sound in the tree which is kind of bogus
03:14:31zacharycarterI mean the fact that stupid ass GDScript still exists bugs me
03:14:45skrylarpeople like to whine about gdscript but it works
03:14:55zacharycarterwell - I see it as another thing to maintain
03:15:05zacharycarterit's like UnrealScript
03:15:15zacharycarteror booscript
03:15:17skrylarthe reason some of those exist is because they do things different
03:15:18zacharycarterand we all saw how those worked out
03:15:28skrylargdscript is meant to be clipped on to nodes and be all over the place; lua doesn't really do that
03:15:42zacharycarterno one wants to learn them, no one wants to maintain / keep them up to date with the engine
03:15:43skrylarand i say this as a person who likes lua, but the scripting experience for lua-backed engines is to just slap the user in to one huge lua file
03:16:24zacharycarteryeah - lua isn't the best answer either
03:16:33skrylarUnity I guess gets the experience slightly better in that you can do one class as an attached behavior to an object in the editor
03:16:39zacharycarterbut you get into scripting languages / hot reloading etc and you create a lot of debugging issues in the end tbh
03:16:44*endragor joined #nim
03:16:47zacharycarterUE4 IMO gets it right
03:17:02zacharycartervisual scripting - if you don't want that, dive into C++
03:17:09zacharycarterand you can add whatever scripting layer you want to if you really want
03:17:10FromGitter<gogolxdong> If you guys master python ,guide me somehow , https://github.com/gogolxdong/pyvmomi
03:17:28skrylari tend to disregard a lot of language complaints in this case because they usually sound like whining
03:17:34skrylar"it's not C++ so its shit"
03:17:54zacharycarterI just don't want to have to learn a language / syntax I'm going to use in one capacity
03:17:57zacharycarterthat shit is annoying
03:18:01skrylarmy prime complaint with gdscript is that it handles by-refs inconsistently, so my procedural forest generator for a scrapped game ran in to issues generating maps and passing them efficiently
03:18:12skrylarthe syntax is like 99% python
03:18:37zacharycarterdoesn't matter - I still have to dive into their docs, figure out why my code doesn't do what I expect it to
03:18:44zacharycarterdeal with their inefficiencies, like you just described
03:18:55skrylarthis is true of literally everything
03:19:19zacharycarteryeah - but the difference is, I might be able to use that other language outside of Godot
03:19:31zacharycarterthis is the same problem I had with UDK / Unrealscript
03:19:41zacharycarterI learn your bullshit language so I can write games for your engine
03:19:51skrylarto be fair to unreal, unrealscript was made before there even were commodity scripting engines
03:20:07zacharycarterno way - angelscript, lua C++ engines existied back then
03:20:16skrylarin '91?
03:20:24zacharycarterI'm talking about like UE3
03:20:31zacharycarterwhich had unrealscript still
03:20:43zacharycarterUE4 was the first engine to ditch it and just go C++ and visual scripting
03:21:05skrylaranyway, i couldn't care less.
03:21:07zacharycarterbring your own scripting language if you want it
03:21:11zacharycarterwe open source the engine - you do what you want with it
03:21:14skrylarif it were up to me things would be in smalltalk or similar
03:21:25zacharycarterhave you looked at Godot's source code?
03:21:25zacharycarter:P
03:21:35zacharycarterwell we can at least agree that smalltalk is the shiz
03:21:50skrylarsmalltalk v. rebol has me in a conundrum
03:22:01skrylarrebol syntax is so easy to parse and ply around that i've already done 80% of it
03:22:41zacharycarterlol
03:22:58skrylarbut it does read backwards.
03:23:24skrylarsomething: dot vec1 vec2 * 2 (i don't do what you think i do)
03:23:28zacharycarteryeah - it's like Nim vs Rust
03:23:42zacharycarterno one knows about the former
03:24:18skrylarsmalltalk sort of obliges you to write a devkit because the language is literally incomplete without a gui
03:24:37skrylaralthough with modern stuff, the verbosity is a non-issue
03:25:08zacharycarterwhat implementation do people even use now adays?
03:25:12skrylarpharo
03:25:20skrylar(though gemstone and visualworks still live)
03:25:55zacharycarterI really need some OOP languages to bring to the table to compare to what we deal with today at work, so thank you - I'm going to check out Pharo
03:26:31skrylarrebol has some nice advantages but parsing and evaluation is weird because its RPN-esque with no parens, so you literally have to know the arity of a function before you can call it
03:26:47skrylaryou literally cannot parse `dot v1 v2` without knowing already that dot is a function
03:26:48zacharycarterooph
03:27:32skrylarPharo is neat but they have no real priority towards say, tree shaking
03:27:53skrylarand polymorphing objects at runtime is hard to code (if you're doing your own ST)
03:28:52skrylarST's technically have a fixed layout in memory, so you have to stop the world to rewrite all references to a struct
03:29:23zacharycarterwhat is a ST?
03:29:55skrylarsmalltalk-80 == ST-80
03:30:16zacharycarterah okay
03:31:39skrylarit would be pretty funny to write shaders in smalltalk.
03:31:43skrylari think everyone would hate it
03:33:23zacharycarterhaha - well writing shaders is a PITA anyway
03:33:44zacharycarterit's espeically annoying w/ libs like BGFX - you write them in one language but have to cross compile them to the target API
03:34:17zacharycarterone thing I could never figure out how to do well is set up a cross compilation pipeline with BGFX projects
03:34:25zacharycarterI ended up using docker to compile the binaries, so the end user wouldn't have to install a cross compilation toolchain - but I'm sure there are better ways
03:34:32zacharycarterI wonder how the big boys do it
03:34:54skrylarthey either write every shader multiple times, or they write an in-house shader compiler (ex. unity or ogre's shader engines)
03:35:06skrylarbgfx shaders are text files that get abused by a C preprocessor
03:35:08zacharycarteryeah but what about the binaries
03:35:31zacharycarterhow do you develop on a windows machine and produce a binary that will run on OSX?
03:35:53skrylarone does not cross compile to mac
03:36:01skrylartim's garden does not like it
03:36:17zacharycarterwell linux whatever
03:36:35skrylaryou generally cross compile from linux to windows, if at all
03:36:45zacharycarterlike I know when I made frag I needed to produce windows binaries
03:36:47skrylarotherwise you have a build slave that runs natively on that OS and does the
03:36:50skrylarbuild
03:36:55zacharycarterso it was - write a docker image to install all the mingw shit I needed to cross compile my binary for windows
03:37:13zacharycarterso when you install UE4 - you're installing the cross compilation toolchain too then I guess?
03:37:14skrylari never learned docker. this is a character flaw
03:37:56zacharycarterthe nice thing about containers / docker is you can just spin them up without actually installing any software besides the daemon that hosts the container on your OS
03:38:12skrylarwell gcc has to be explicitly built as a cross compiler afaik, whereas clang allows you to plug in other platforms. so if you use clang++ and never make OS calls, you can just tell it "give me a mach .O file" or such
03:38:34skrylarif you make os calls then you need the headers as well
03:39:09zacharycarteryeah - that was the thing - I was definitely making OS / filesystem calls
03:39:22skrylarwere they done through a platform shim?
03:39:49zacharycarterwell - through Nims stdlib so I guess so
03:39:57skrylarDunno then
03:40:07zacharycarterhere's what I had to do -
03:40:08zacharycarterhttps://github.com/fragworks/frag/blob/master/Dockerfile
03:40:32zacharycarterhttps://github.com/fragworks/frag-android/blob/2cb58226a7df4baf13192bf941803c9747e0a4b4/Dockerfile
03:40:40zacharycarterso that's android compilation
03:40:42skrylarbleh. may keep with rebol for shaders. people like their text editors
03:40:55skrylarone of the largest complains with smalltalk is "i can't use my precious text editor with it"
03:41:46skrylarwell, i used rkt a few times
03:42:00skrylarthey have something similar to dockerfiles. but local image reuse was broken at the time
03:42:13zacharycarterwell - it's just very confusing
03:42:35zacharycarterlike how do you enable someone with a certain OS to build software for another OS without making them install half of the internet?
03:42:37skrylarineed to set jenkins back up to test nimble packages between stable and master
03:42:47zacharycarterugh fuck jenkins
03:42:47skrylaryou don't
03:42:48zacharycartergitlab
03:42:54skrylaryou have build slaves =p
03:43:00zacharycarterhahaha
03:43:15zacharycarteryeah but I mean if someone installs UE4 / Unity they don't have build slaves
03:43:38zacharycarteralso how do you handle testing?
03:43:45skrylari'm pretty sure a multimillion dollar studio has found a way to license compiler tech :|
03:44:00skrylaralthough crossing from anything to android is not special
03:44:12zacharycarterlike okay sure your program compiles, but what about RTEs?
03:44:27skrylarthe normal way to build android is to cross to android, using the sdk+gcc+(whatever dex got replaced with)
03:44:34zacharycarteromg dude - the android NDK is somewhere you never want to go
03:44:51zacharycarterbeen there - never want to go back
03:45:02skrylaralthough one thing i read is apparently crossing to raspi is broken or something
03:45:12skrylarthe last time i went 'there' they said to do hilarious things with distcc
03:45:32skrylari guess distcc can pick up ARM build jobs from non-ARM hosts as long as the ARM host kicks the job off
03:45:41zacharycarterlol
03:45:49zacharycarterlinux is great
03:46:51skrylarblegh. i have more yaks to shave tonight
03:46:56zacharycarteroh I didn't realize what distcc was
03:47:08zacharycarterinteresting
03:47:29skrylarwhat i want to do: implement this neat simple IK solver because it sounds cool, but what has to actually be done: more json bytecode hell
03:48:01skrylarCCD and Fabrik are ... simpler than i thought ik solvers were
03:48:53zacharycarterI've done zero with IK - inverse anything scares me
03:49:30zacharycarteradd the word kinematics to the situation and I'm out
03:49:32skrylari have seen some gdc talks on animation this past week and they are things from overgrowth synthesizing fluid animation from keyframes and interpolation (this is why skeasing and skinterpolate got fixups)
03:49:57skrylarubisoft was using IKs to copy animations out of mocap libraries to arbitrary skeletons
03:49:59*mr_yogurt quit (Ping timeout: 260 seconds)
03:50:01zacharycarteryeah the guy(s) that wrote that engine are stupid talented / smart
03:50:18skrylarhttp://sci-hub.tw/https://doi.org/10.1016/j.gmod.2011.05.003 have a looksey at how simple fabrik IK actually is
03:50:47skrylarbasic geometry
03:51:56FromGitter<Varriount> Whatcha up to zacharycarter?
03:52:09skrylarvarriount werent you part of this vmware sdk soap business
03:53:18zacharycarterVarriount: not much bud - real life has been kicking my ass but hopefully I'm soon going to be on the other end of all that
03:53:26*yglukhov[i] joined #nim
03:53:51zacharycarterI literally have spent the past month dealing with Sears / Lowes trying to get 4 appliances delivered to my house so I can finally put it on the market
03:54:01*mr_yogurt joined #nim
03:55:01zacharycartersupposedly I'll get the last stupid appliance next week, and then assuming my house sells I'm going to quit my job and or start job hunting
03:55:01zacharycarterhow are you?
03:55:41zacharycarterskrylar: lol the 41 steps got me
03:56:36zacharycarterI'm so bad at reading white papers - I just want someone to give me code I can port, but that's probably why I'm not you / Araq :P
03:56:51skrylarI am not so special
03:57:37zacharycartermeh - you're definitely a smart guy, and I form that opinion based on my interactions with you over the past year or so
03:57:41skrylarthe other night i was having issues comprehending lattice deformation even though i know what it "does"
03:58:09skrylarthe only authorative source i found was a vague description of a gdc post saying its just bone deformation with cubic interpolated weights
03:58:13skrylar:|
03:58:24zacharycarterlol
03:58:31zacharycarterso helpful
03:58:38*yglukhov[i] quit (Ping timeout: 255 seconds)
03:59:08skrylarone day i would like to see the nim-native voiceloop working, but i have to fight off arraymancer bugs
03:59:41zacharycarterthat's what I love about Nim though - between you, Varriount, Dom, Araq. Mratism, Yuri, Krux, Arne, and everyone else that's stupid smart in this community, I think the Nim community has some of the most intelligent people I've ever encountered in a programming community
04:00:31zacharycarteryou can't say the same thing about the mountains of fan boys who go add RIIR comments to every github repo that isn't written in Rust
04:00:40skrylarriir?
04:00:44skrylarthe trick is to start reading them and then desperately google how to read them
04:00:47zacharycarterrewrite it in rust
04:01:04zacharycarter:P
04:01:05skrylarthe only time i ever tried to write in rust i broke the stdlib
04:01:27zacharycarteryeah well if you're not doing that or fighting the borrow checker you're doing something wrong probably
04:01:27skrylari break the nim compiler all the time but at least that's because i did something silly
04:01:49skrylar "this is a public template that calls a non-public module function" -> boom
04:01:51zacharycarterso much rust hype at work from people who have never written a lick of C++
04:01:56zacharycarterlol
04:02:28skrylarmaybe i should send in a pr that just does an 80x24 ascii bomb when you break the stdlib
04:02:55skrylarthere is an app in arch's pacman that when you type sl instead of ls it stops your terminal to draw a steam train
04:03:26zacharycarterlmao
04:03:56zacharycarterI can't even convince people at work that debian is a better distro than alpine
04:04:03zacharycarterfor docker base images
04:04:23zacharycarterpeople don't understand stepping down from root but they want to install antivirus on containers
04:04:30skrylarOkay you're going to have to sell me on that one
04:04:50zacharycarterokay alpine gets 1 100th of the attention that debian does
04:05:03zacharycarter1 1000th is more like it
04:05:32skrylaralpine has a docker-native release that is like 2mb or something total, uses uh, muscl as a stlib (not the glitchfest that is glibc) and has a pacman-esque package manager
04:05:33zacharycartersmall footprint and all - I guarantee the distro sees more vulnerabilities / less attention than any other distro
04:05:36zacharycarternot to mention muscl vs glibc
04:05:40skrylaralso built-in grsec
04:06:23skrylar(although grsec is not even available to the public in beta form; i am quite sad)
04:06:36skrylarthey tried to donate the work to linux but linus would rather play politics than fix his fucking OS
04:06:51zacharycarterwell linux is a shitshow to begin with
04:07:00skrylarthe amount that i want planbsd9 as an os is incalvulable
04:07:06skrylar*incalculable
04:07:18zacharycarterBUT - I would rather trust a distro that recives the majority of the communities attention
04:07:48zacharycarterwell I've been screaming for openbsd at work for PCI compliance because I'm tired of this docker antivirus convo nonsense
04:08:05skrylaralpine tries for security and minimalism which are commendable; the base install even goes so far as to have immutable base system and temporarily overwritten user data
04:08:17skrylaropenbsd doesn't handle multiple cores last i checked
04:08:25zacharycarteralso - I see so many alpine images that shoehorn glibc into them because they need it
04:08:29skrylari poked a year or two ago and it was still choking on threading iirc
04:08:51zacharycarterI don't think it does either :/
04:09:02skrylari know rkt runs on bsd (which is part of why i cared)
04:09:09zacharycarterbut I mean - most of the webapps my company runs, especially the ones that need PCI compliance, could probably run on a single thread
04:09:20skrylarRocket is a spec whereas Docker is a product. So there are ex. rocket runtimes that work on BSD, and simply map the containers to bsd jails
04:09:36zacharycarterI need to check out rocket then
04:09:47skrylarkubernetes gave rkt the green light
04:10:37zacharycarterwell then this just brings so much more ammo to destroy my terrible architect
04:10:38zacharycarterthank you
04:10:42skrylari dislike apt from the dev side, speaking of debian
04:11:13skrylarpacman and i think alpine's appk thing, you sorta just give it a bash blob and it figures out what your package needs
04:11:15zacharycarterhow come?
04:11:22skrylardebian has an ENTIRE DIRECTORY of beurocracy to fill out just to get a deb
04:12:33skrylarrpms are unpleasant but scriptable to work around
04:12:45skrylarpacman is literally i copy a template PKGBUILD file and then edit some fields, tell it how to run make
04:12:49zacharycartergotcha
04:13:44skrylarprocedurally debian is quite responsible; with the whole "we call it stable when ten days without a bug report happen" type thing
04:13:51skrylarit's just that their packaging system is bloated
04:14:12skrylarwell, it goes from unstable to testing after ten days of no issues
04:14:34zacharycartermmph - yeah - the former is what I really garnered from looking into debian vs alpine but I didn't consider package management at all
04:15:01zacharycartermy thought process went like this -
04:15:21skrylarwell debian has a security team but they only care about stable (read: heavily outdated) releases
04:15:39skrylaralpine security is proactive (use more secure / responsible developers)
04:15:44zacharycarterI need a base image for my docker containers - alpine or debian? Well if I go with alpine I'll probably not have a chance to eventually replace all my golang code with Nim code while no one is looking
04:16:30skrylarare you running a hardened service or just testing code
04:16:43skrylarif you're testing nim code you should be building on the average devbox OS
04:16:51zacharycarterIt's funny - because if you google alpine vs debian you find a lot of the exact opposite sentiment (although no one goes into the detail that you did) regarding the attention alpine gets vs debian
04:17:06zacharycarterno this would be production code eventually
04:17:15skrylarproduction code isn't always hardened either
04:17:27zacharycarterbut I mean - it doesn't seem like the people even running the show at my company know what they're doing
04:17:40skrylarthey probably don't
04:17:55zacharycarterso I'm really just relying on kubernetes at this point
04:17:58zacharycarterand hoping whoever stands up our kube cluster knows what they're doing
04:18:09skrylari have never used kube :\
04:18:16skrylari mean i like the whole terraform/nomad/kube concept?
04:18:28zacharycarterwell
04:18:34skrylarwell nomad and kube don't get along iirc
04:18:42zacharycarternomad and kube are comparable
04:18:50zacharycarterterraform is built by the company that makes nomad
04:19:09skrylari just know that i liked the ideas they had and especially being datafile driven you can shove them in Phabricator
04:19:23zacharycarterterraform is basically a terrible product that allows you to write this fucked up language called hashicorp language to provision infrastrucutre on different providers
04:19:37skrylaris it terrible?
04:19:58skrylari looked at it briefly; the configs looked weird, and from what i could tell it just like.. lets you define requests for VMs
04:20:03zacharycarterit's slightly better but at the same time way more frustrating than using the cloud native tooling each vendor provides IMO
04:20:27zacharycarterone sec
04:20:33skrylari think you would need nomad for an erlang shop from what i could tell?
04:20:34*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/puAkljSoNUOxjOSsLdMHFuoj >
04:21:02zacharycartermaybe - not sure if kubernetes would support beamvm or not
04:21:07skrylarone thing thats weird is that erlang doesn't "go down", you hot swap new code in it; but container culture is to kill it and restart
04:21:15skrylarsmalltalk can work this way as well
04:21:15zacharycartererlang is amazing
04:21:18zacharycarterfor enterprise software
04:21:32skrylari had a conversation today where Wings3D came up (also an erlang thing)
04:21:36zacharycarterlike if you want redundancy, scalability, fault tolerance, etc - there's no reason you shouldn't be using the beamvm
04:21:40skrylarI might have to peek in their code and spork some of it
04:22:04skrylarwas talking earlier abotu how i really do not want to waste my life cloning everything under the sun (like blender) but blender's soulless automata creating it make me sad
04:22:08zacharycarterelixir + pheonix is where it's at for webapps
04:22:22zacharycarterwell people are doing cool things w/ blender now
04:22:33zacharycarterhttps://armory3d.org/
04:22:36skrylaryou can do good jobs with blender, that is not the issue
04:22:46skrylarits that the core team is out of touch with the world
04:23:02skrylarPBR has been out for how long as standard practice? and they haven't moved a finger to support it?
04:23:09skrylarthe community wrote cycles modules and they still aren't merged?
04:23:16zacharycarteroh - yeah - that I have no experience with but I believe it
04:23:19zacharycartertheir GUI looks like it was created in a vaccum
04:23:27skrylarTon doesn't give a shit about anything
04:23:30skrylarhe just wants to make his short films
04:23:44zacharycarterlol
04:24:02skrylarthey completely neglect the game industry and like, they had broken IK solvers for years
04:24:16skrylarand then i pop open these web pages and find out constriant-obeying IKs have been public knowledge forever
04:24:23skrylarand the animation industry uses them
04:24:25zacharycarterwell look what happened to their "game engine"
04:24:47skrylarto be fair, if you do things too exotically everyone hates you ^^
04:25:04skrylarhaven't got the links still, but one example is that menus are considered horrible ideas in UX
04:25:35zacharycarterso put them everywhere!
04:25:37skrylarSorting menus alphabetially is objectively better (because non-sorted menus are O(n) scanning, but sorted are O(log(n)) or something)
04:25:39zacharycarterand then make them only accessible through obscure hotkeys
04:25:45skrylarThere was a real whitepaper journal study done on this
04:25:58skrylarthey look weird as shit but they found people found features quicker
04:26:07skrylaralso the long-abandoned pie menus are like usability gold
04:26:30skrylarfor menus with less than i think 12 items
04:26:43zacharycarterwhen I first opened up blender and found out that I wasn't going to be able to use it with a trackpad on my macbook I immediately closed it and installed modo
04:26:57skrylarbecause the act of using the menu also encodes the uscle memory for the action that does the thing, you actually speed up over time with a pie menu (compared to regular menu, where you don't)
04:27:02zacharycarterand then found modo to be 100x more enjoyable to use than blender
04:27:05skrylaryes, modo is great
04:27:24skrylarbut thats the difference 800$+ in licenses costs
04:27:33skrylarits like 2k these days i think?
04:27:37zacharycarterI'll pay it to not have to deal with blender
04:27:40zacharycarteryeah it's expensive
04:27:44skrylari appreciate blender's spirit
04:27:50skrylari don't trust modo now that the foundry owns them
04:27:59skrylarfoundry loves them some DRM and luxology were traditionally anti-drm
04:28:03*xylef quit (Quit: WeeChat 2.2)
04:28:18zacharycarterI realized I wasn't going to be a 3d modeler after I made a killer 3d model
04:28:45skrylarwell if i was going to waste my life making 3d modeling software i would start by duping wings3d/nendo
04:28:54zacharycarterand then couldn't unwrap / uv / bump map etc the model without doing everyting all over again with tears rolling down my face
04:29:14skrylarwelcome to 2018 where UV mapping is for losers
04:29:22skrylarPTex \o/
04:29:33zacharycarterI just gave up on making games
04:29:38zacharycarterI just want to make things that make games now
04:29:43skrylar3d coat inspired me a bit
04:29:44zacharycarterbecause I realize making games is not going to happen
04:29:49zacharycarter3d coat is the shit
04:29:52zacharycarterthat software is amazing
04:30:03skrylar3d coat is voxel based; i blew some college money back in the day on a license. need to get back in to it this week :\
04:30:11skrylarmodel and then polygonize is the way to go
04:30:26skrylaryou can also google "kizamu sculpting" for something that only existed as a prototype; scultping with distance fields
04:30:43zacharycarterman voxels are so confusing lol
04:30:50zacharycarterlike every year I see the same old voxel engine rehash about how it's going to be the next big thing
04:30:53skrylardistance fields are confusing
04:30:56zacharycarterand then like ten years later the same voxel engine looks the same
04:30:56skrylarvoxels are easy
04:31:28skrylari think my 'dream modeler' is wings with a distance field sculpter attached
04:31:31zacharycarterhttps://www.voxelfarm.com/index.html is the only guy I've found who really knows how to use voxels right
04:31:44skrylarwell marching cubes was depatented recently
04:31:45zacharycarterhis blog is ridiculous
04:31:58skrylarone of the core voxel patents was forcing everyone to use suboptimal tesselators forever
04:32:08skrylarand fixed pipeline GPUs meant we couldn't raytrace en masse
04:32:32skrylarnow that we can program arrays of 900mhz CPUs, voxels and raytracing systems are coming back
04:33:11skrylarwith voxels/distance fields, you can model by just purely sculpting details ex nilho
04:33:17skrylarworry about the polys later :3
04:33:41skrylaractually distance fields allow mechanical modeling with adjustable welds, so you can contorl the way that boolean models merge together
04:34:36skrylarthere is an nvidia paper where they did real-time ptex on the gpu; stored every mipmap level on a single texture (no mipmaps)
04:35:07zacharycarterhttps://www.voxelquest.com/news/every-version-of-voxel-quest-ever
04:35:29skrylarmy only question is why do the toys only exist in whitepapers :(
04:36:01skrylaris it because IBM proved most developers are hacks?
04:36:13zacharycarterthat's the thing right - I feel like people have been playing with voxel rendering engines for the past thirty years with no real results
04:36:14zacharycarterbesides comanche gold etc
04:36:15zacharycarterand delta force
04:36:39skrylarhttps://www.evl.uic.edu/vchand2/thesis/papers/kizamu.pdf
04:37:10skrylarwell, one trouble with voxels is that getting them to models is annoying
04:37:23skrylarbut now with Instant Meshes, perhaps not so much anymore
04:38:15skrylartheres another paper where you can take a point cloud or hipoly mesh and it creates a position field, then creates a model with controllable poly count from it, and even give it mental help in places where it gets orientation wrong
04:38:42zacharycarterI think there's too much tooling / practice around polygonal modeling
04:38:46skrylarArt doesn't need to be suffering these days, we just need more brilliant people implementing this shit
04:38:59zacharycarterlike it'd be a huge industry disruption to abandon all of that and move towards a voxel based solution
04:39:28skrylarsome of it is that there is little oxygen in the room
04:39:39skrylar(or in more known business terms, the 3d modeling space is a very red ocean)
04:39:58skrylarindies just get crushed under the never-ending use of maya/max
04:40:04zacharycarteryeah
04:40:15zacharycarterwell - I think if you can wrap your head around how to leverage it - https://www.sidefx.com/ is the winner
04:40:34zacharycarterhttps://www.sidefx.com/products/houdini-core/ is amazing
04:40:43skrylarI have heard houdini is a great animator. I don't know why people think that
04:40:49skrylar(i refuse to use dongled or activated software)
04:41:06zacharycarterit's more than that
04:41:11zacharycartercheck this out
04:41:51zacharycarterhttps://vimeo.com/150180595
04:42:47zacharycarterit's all node / parameter based and then you construct nodes to procedurally generate scenes
04:42:56skrylarah. procedural stuff is fun
04:43:04skrylari've wanted a clone of substance designer for a while
04:43:22zacharycarteryou wouldn't use it to base model a human for instance
04:43:25skrylari think it can be done by leveraging graphicsmagic probably
04:43:40zacharycarterI can ship you a copy of substance probably - I have it pirated I'm pretty sure
04:43:49skrylari have a license
04:43:51zacharycarterI also have a legit copy - but it's over my head to use it
04:44:09skrylari have a now outdated filterforge and designer/painter
04:44:13zacharycarterI get to the point where I've made something in modo / maya / 3ds max
04:44:15zacharycarterthen I fall apart
04:44:29zacharycarteryeah - their licensing is bullshit
04:44:36zacharycarterI also have a copy of zbrush8
04:44:41zacharycarterbut again - I suck at art
04:44:50skrylarzbrush can go to hell (web activation)
04:45:00zacharycarteromg I'd love to be good at zbrush
04:45:00skrylari tried it and having to screw with polygons was lame
04:45:03zacharycartersuch a sexy app
04:45:07skrylar3dcoat \o/
04:45:19zacharycarteryou don't have to mess with polys in zbrush!
04:45:34skrylaryou actually do, you can screw up the polys if you pinch too much
04:45:55zacharycarterwell - they have a mode where you don't mess with polys at all
04:46:33skrylari think zbrush is the best polysculpter on the market, probably. i also think voxel sculpting is superior (3d coat), and distance fields are probably the pinnacle
04:47:02zacharycarterI've never done voxel sculpting with 3dcoat - I was just using 3dcoat to retopo stuff
04:47:05skrylarvoxel sculpting still has resolution tuning; ASDF's automatically adjust resolution to fit
04:47:16zacharycarterI didn't even realize it could do that
04:47:23skrylarthats sort of its big thing
04:47:34zacharycarterwell - i think that's what zbrush tries to do
04:47:36skrylarmy best work has come from 3d coat sculpting
04:47:44zacharycarterit like adds / subtracdts polys in an abstract fashion
04:47:59zacharycarterhrm - I need to play around more with 3d coat I guess
04:48:21zacharycarterI'm guessing your best work looks better than mine haha
04:48:21skrylari have some udemy classes on it
04:48:23zacharycarterI'll link you to my latest model that I failed to do anything with
04:48:58skrylarhttps://farm7.static.flickr.com/6128/5932760077_e580e26c24_b.jpg
04:49:00zacharycarterhttps://lh3.googleusercontent.com/-5KsyAhd4-j8/WfNUe9lC71I/AAAAAAAAMFU/_XMb7RFo5Ys9HJvqyz9CNJ4kSfQLYxkKgCL0BGAYYCw/h720/RenderFinal.png
04:49:33zacharycarteronce I made that gun though - I couldn't do shit with it
04:49:55zacharycarterlike I could follow a tutorial on UVing it and then when I went to make normal maps everything would turn out shit
04:50:10zacharycarterspent about two weeks trying to figure out how to make it usable and then gave up :/
04:50:23skrylarnormal maps are not so hard but its one of those things people don't like to give straight answers on
04:50:49zacharycartereven the fuckers at modo couldn't help me
04:50:52*yglukhov[i] joined #nim
04:50:52zacharycarterthey were like - well try blowing up the model and uving everything seperately etc
04:51:00skrylar3d coat will do your normals for you from a voxel
04:51:06zacharycarterI tried generating UV maps in substance, modo, maya etc
04:51:14zacharycartermeh - maybe I just need to try that then
04:51:18skrylarif you import the model to voxel space and retopo it in the retopo room, it will auto-cage and bake normals from the sculpt to the mesh
04:51:24zacharycarterI literally spent like 3 weeks on that model
04:51:34zacharycarterand was so pissed when I couldn't do anything with it
04:51:34skrylaryea, sounds like you just hit a knowledge failure
04:51:37skrylaram familiar with those
04:51:47skrylaroften times if something seems ridiculously hard its because a fundamental is missing
04:51:57zacharycarteryeah
04:52:14zacharycarterwell - I figured I shouldn't have tried to make a gd rail gun as my first big modeling project
04:52:20zacharycarterI should have probably made like a bolt or something
04:52:24skrylaranother thing you can do, at least nowadays, is just let the sculpter auto-mesh for you
04:52:34skrylaryou can take the stupidly high-res out and flop it in to instantmeshes
04:52:39zacharycarterbut I did go through some basic modeling lessons first - it's just none of them took you through the entire process of uving, normal mapping etc
04:52:57*cspar quit (Ping timeout: 240 seconds)
04:53:02skrylarnormal mapping is automatic
04:53:07skrylarUV mapping not so much
04:53:17*Jesin joined #nim
04:53:22zacharycarterugh - yeah I need to explore new tooling then - I struggled way too hard / long on that one
04:53:44zacharycarterI liked the model - I mean it looks like a generic ass sci fi weapon - but I thought it looked decent
04:53:47zacharycarteryeah UV mapping was no problem
04:53:55skrylar3DC and blender have least-squares-conformal-mapping, which means you just set the seams and it lays it out for you
04:54:03zacharycartergenerating the normal / bump / etc maps was the bitch
04:54:05skrylarwings also has an auto uv mapper based on painting zones
04:54:31skrylarworking with UVs is one of those things tht still happens but should not be happening, because ptex and projection painting obsolete it
04:54:32zacharycarteryeah - I originally wanted to just get 3ds max but I'm on osx and I don't like using my desktop pc so I went with modo to model it in
04:54:51skrylarptex was made by disney for films
04:54:57zacharycartermaya sucks ass on OSX - just breaks randomly
04:55:08zacharycarterI've never even heard of ptex before you brought it up tonight
04:55:08skrylareach face gets its own texture, can have its own resolution level, and knows its neighbors
04:55:10*xylef joined #nim
04:55:17skrylar3d coat also supports ptex and projection painting :)
04:55:46skrylarso instead of uv anything, disney just paints on models and forgets about it
04:55:50*Jesin quit (Max SendQ exceeded)
04:55:55*yglukhov[i] quit (Ping timeout: 268 seconds)
04:56:01zacharycarterdoes it bake out to OBJ / FBX etc?
04:56:09zacharycarteror do you need a ptex parser?
04:56:17*Jesin joined #nim
04:56:23skrylarit outputs native ptex files i think
04:56:48skrylarthere are ways to use ptex on your video card in real time (i could try to find the nvidia paper for this) by reading the ptex and texture packing in to an atlas
04:57:17zacharycarterhttps://polycount.com/discussion/123319/why-is-ptex-not-used-in-games
04:57:17skrylarzbrush does something like this with its auto uv mode; it just craps out the equivalent of ptex but as a jumbled uv map
04:57:27zacharycarterjust reading through that
04:57:37zacharycarterah okay
04:58:24*Jesin quit (Max SendQ exceeded)
04:58:39zacharycarter` I regularly bake down stuff from HighP meshes with Ptex to Lowpoly UV's in Mudbox`
04:58:41zacharycartersounds like what I should be doing
04:58:57*Jesin joined #nim
04:59:18zacharycarterlol last comment
04:59:20zacharycarterthis will get you going
04:59:28zacharycarter```
04:59:28zacharycarter I'm surprised nobody mentioned Rage, Megatextures are basically ID's version of PRT. Technically with their implementation you should be saving texture memory since you're not wasting UV space and only the textures visible are being loaded into memory.
04:59:29zacharycarter```
04:59:48zacharycarterI remember sometime last year you were looking into those haha
05:00:10skrylaryes, sean berret (of stb_* and nothings.org?) has a talk on them
05:00:41zacharycarterI've actually read / encountered a lot of hate for that guy
05:01:21zacharycarterpeople saying his libs have a lot of issues, espectially stb img
05:01:31skrylarhttps://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=2ahUKEwiAk-iFsarcAhUFY6wKHcrlCB8QFjABegQIAxAC&url=https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FKarl_Hillesland%2Fpublication%2F254002906_A_space-efficient_and_hardware-friendly_implementation_of_Ptex%2Flinks%2F55158fd30cf2f7d80a334827%2FA-space-efficient-and-hardware-friendly-implementation-of-Ptex.pdf&usg=AOvVaw3XkGfLNHOyD_5DnL08cNdC
05:01:35*_dorelix quit (Quit: Leaving)
05:01:38*Jesin quit (Max SendQ exceeded)
05:01:48skrylarits AMD not nvidia, my bad
05:02:04*Jesin joined #nim
05:02:45skrylarthey convert a ptex in to a tightly packed atlas, then interpolate the edge pixels with the neighbors to prevent artifacting, and they are able to store the entire texture + mip levels in a single sheet (instead of UVs having to have separate mip sheets)
05:03:21skrylarnow we just need someone to use libmypaint, run the brushes through a 3d projection and paint on to model layers :)
05:03:45zacharycarter:)
05:03:48zacharycarterhttps://github.com/RandyGaul/cute_headers - I like this guy
05:04:14zacharycarterover sean barnett or whatever his name is
05:04:17skrylarstb libs are not for public consumption. they are for people who just want a thing that works and control the inputs (game developers)
05:04:27*Jesin quit (Max SendQ exceeded)
05:04:57*Jesin joined #nim
05:04:58skrylarraylib uses them, i generally don't
05:05:16skrylarstb_image is cute, but under the circumstances give me flif and webp
05:06:18skrylarwe'd need a gui, but i wonder how many people would use a pipeline tool from nim :hrm:
05:06:23zacharycarterzengine is basically just a giant port of raylib to Nim
05:06:25skrylarmonogame still uses theirs for importing content
05:06:45zacharycarterI think I added skeletal animation and a few font rendering techniques like SDF
05:06:48*Jesin quit (Max SendQ exceeded)
05:06:53zacharycarterbut other than that it is literally raylib in Nim lmao
05:06:54skrylarhow did you get sdf to work
05:07:03skrylari've never gotten sdf fonts to work
05:07:07zacharycarterSDF is just shaders
05:07:17*Jesin joined #nim
05:07:40skrylari had this thing where you could paint 2d distance fields and my shaders had jaggedly edges, which the valve papers don't have (yet when i use ex. SDFs in godot, they have jaggedy edges too.)
05:07:41zacharycarterlet me try to remember - I know if it's not in zengine I have code for it in frag
05:08:14skrylaralso the s3tc patents expires \o/ but we have ETC now in spec https://en.wikipedia.org/wiki/Ericsson_Texture_Compression
05:08:37*Jesin quit (Max SendQ exceeded)
05:08:48skrylarericcson is mandatory for GLES3
05:09:05*Jesin joined #nim
05:09:10zacharycarterI'm pretty sure I followed this guide - https://github.com/libgdx/libgdx/wiki/Distance-field-fonts
05:11:01skrylari'm not sure i'm happy with what passes for a game engine
05:11:07skrylari wish they were just called rendering toolkits
05:11:12zacharycarterI don't know if I still have it - I know that I went back and forth on whether I should have included it in zengine or not
05:11:27skrylarwhen i think game engine i for some reason expect this to include things like dialogue trees and you know, the things a game actually needs
05:11:38*Jesin quit (Max SendQ exceeded)
05:11:46skrylarbut i see game engines that don't even have UIs
05:11:49zacharycarterat the time I was really interested in font rendering for rougelikes and didn't quite understand how bitmap fonts worked
05:11:57zacharycarterso I was exploring / implemented SDF rendering until I realized I could just use a bitmap font
05:12:06skrylarsdfs are bitmap fonts ;p
05:12:06*Jesin joined #nim
05:12:17zacharycarterwell just with shaders packed on top
05:12:23zacharycarterwhat I mean is like
05:12:31zacharycarterI wasn't rendering the font from a single bitmap image
05:12:42zacharycarterand using coordinates to specify which characgter to render
05:12:43skrylaroh. atlasses
05:12:50zacharycarteryeah that's what I mean
05:13:10zacharycarterso I went with SDF at first - and I was like - how the fuck do rougelikes do this with just a single image
05:13:17skrylardepending on what GL you have, you can get font rendering pretty compact
05:13:21zacharycarterand then when I figured that out - I abandoned SDF
05:13:42zacharycarterwell - now whatever I write in the future I'm not using GL :P
05:13:49*Jesin quit (Max SendQ exceeded)
05:14:17*Jesin joined #nim
05:14:33zacharycarterI'm really thinking about abandoning linux / osx all together, going back to windows and learning DirectX
05:14:43*skrylar starts sharpening the shank.
05:14:53zacharycarterand I think whatever rendering lib I write in the future - I'll be using BGFX
05:15:09zacharycarterlol our architect at work doesn't know how to do me /me
05:15:31zacharycarterso he does this thing in slack where he like bolds his emotions - like he'll do nods constantly
05:15:46zacharycarterwith two asterisks so it just shows up as bold
05:16:04skrylardiscord actually just wraps /me messages with markdown _'s
05:16:13zacharycarterand all of us are like - yo how does this guy claim to be an architect - he obviously hasn't been using computers pre 2000
05:16:22zacharycarterwell the best part is
05:16:26zacharycarterI found his old personal blog
05:16:54*Jesin quit (Max SendQ exceeded)
05:17:16zacharycarterhe has a blog post from back in the day where he bitches about how he can't convince his brother that he should buy a mac to play computer games on vs a PC
05:17:58zacharycarterand this is like in the 2000s when we're dealing with half life and quake and unreal tournament and other games that made you want to be a kid forever
05:18:34skrylarreading that polycount post
05:18:51skrylarits true that uvs are useful for slapping textures on things. actually one thing i liked about modo, you can easily use a uv set just for that
05:19:17skrylarblender too but modo has a simple stack-based UI for "use these UVs to add this texture, then those UVs to add scratch map" and blender requires editing node graphs
05:19:32zacharycarteryeah - modo made UVing a breeze for the most part
05:19:42skrylari tried multi-uv stacking in ages past but didn't understand the algebra
05:19:58*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/ALtoKXrJkEVyLBlIaYSwumYp >
05:21:09*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/vefZXAahjunualgdlWNunYup >
05:21:56zacharycartertook him till 2007 to figure this shit out
05:22:17skrylari don't understand some of these posts
05:22:27skrylar"separating uv islands adds more vertices" what
05:22:31zacharycarterI'm pretty sure I was playing doom in 94 when I was 9 years old and doom was out
05:22:53skrylarUVs are not subject to primitive types, only faces are
05:23:14zacharycarteryeah uvs are just groupings of existing topologies right?
05:23:24skrylarthe only reason you would increase vertex count on a model is if you had a different *material* which would require switching out the shaders and doing another pass
05:23:26zacharycarterlike you can't create a new grouping of vertices via UVs
05:23:35skrylarUVs are an *attribute*
05:23:39skrylarof a vertex
05:23:58skrylarthey would never increase the rendering cost
05:24:10skrylarunless you use a separate MATERIAL, which is because you would have to swap shaders
05:24:55skrylari think these people just have stockholm syndrome
05:25:14skrylarthere is a very real problem where people traumatized by inefficient workflow will double down on that workflow because larning new things is effort
05:25:55zacharycarterit's weird - because I'm trying to think of when I load a model with like assimp I don't think of it that way
05:26:27*nsf joined #nim
05:26:59skrylarit is weird yes. what we show artists is not what we shhow hardware
05:26:59zacharycarterwell - artists in general I've found usually just follow a workflow they know, whether it makes sense technically or not
05:27:06skrylarartists just see faces and materials and we see render calls
05:27:35zacharycarterI'm like half way in between there :P
05:27:47skrylartechnical artists are poor sods who see too much
05:28:13zacharycarternot because I understand either that well - but because I don't understand either well enough so I just float in ambivilence and hope my code does what I'm intending it to do :P
05:28:59skrylaractually unwrapping is not so bad with LCSM but i hate seams
05:29:01zacharycarterI am enjoying (a lot) though reading about lower level computing concepts
05:29:22*zielmicha__ joined #nim
05:29:29*odc_ joined #nim
05:29:34zacharycarterI'm just hoping as I go on and start diving into processor architecture / OS fundamentals, that I don't get lost
05:29:35*euantor_ joined #nim
05:29:42skrylarI wonder how pronounced seams are with careful re-baking
05:29:47zacharycarterdoing computer science backwards is hard :/
05:29:49skrylarOr if they are inevitable
05:29:50*odc quit (Ping timeout: 276 seconds)
05:29:52*odc_ is now known as odc
05:30:14zacharycarterin my experience they're not avoidable
05:30:17zacharycarterit's just hiding them correctly
05:30:27zacharycarterbut that's all manual UVing
05:30:30*zielmicha_ quit (Ping timeout: 276 seconds)
05:30:32*zielmicha__ is now known as zielmicha_
05:30:47zacharycarterlike you have to stick that ugly seam somewhere
05:30:59skrylarit is possible to avoid a seam
05:31:04skrylarit is not *easy* to do
05:31:08*donlzx quit (Ping timeout: 276 seconds)
05:31:09*euantor quit (Ping timeout: 276 seconds)
05:31:09*m712 quit (Ping timeout: 276 seconds)
05:31:09*dvn quit (Ping timeout: 276 seconds)
05:31:10*euantor_ is now known as euantor
05:31:26skrylarseams are the result of two edges having dissimilar connectivity
05:31:26zacharycarterbut then of course where you place it in accordance to other seams and the rest of the topology of the model comes into accordance
05:31:27zacharycarterwell yeah - I mean you can retopo away
05:31:28zacharycarterbut eventually you're going to end up with one
05:31:51skrylarlike, ptex is a ton of different interlocking textures == no seams
05:32:16zacharycarterokay so I see where you're going - it should then be possible to figure out that logically and fix it
05:32:36skrylarso does that mean if we are careful to ensure all unwraps are the same logical size / distortion can we somehow just like, let the computer stitch them
05:32:57zacharycarterif two edges are connected in a dissimilar fashion - it should be possible to figure out how to remedy that computationally
05:33:04zacharycarteror that too
05:33:08*euantor is now known as Guest51560
05:33:33zacharycarteryeah - I don't know - whenever I've UV'd models I've done it manually
05:33:39zacharycarterand it's always a feeling out process
05:33:49*avsej quit (Ping timeout: 260 seconds)
05:34:00zacharycarterlike you UV it one way and figure out that you could do it better a different way
05:34:11zacharycarterbut yeah - it makes sense all that could potentially be done algorithmically
05:34:28skrylarwell my old model for that is that you select an area to work on and then generate UVs for that alone, which you then say paint on to; then you do this again somewhere else and it projects them together.
05:35:00skrylarthere might be minor artifacts from re-projection (i haven't tried) but you could smooth the edges with interpolation
05:35:09skrylarbut this requires the uv editor and paint program be intertwined
05:35:31*m712 joined #nim
05:36:02zacharycarterhrm yeah - I've only dealt with them (and then stumbled) in isolation
05:36:13*avsej joined #nim
05:36:13*avsej quit (Changing host)
05:36:13*avsej joined #nim
05:36:25zacharycarterlike I'd hide portions of the geometry, UV them, get to the point where I had everything UVd
05:36:33zacharycarterbring it into another program like substance and end up with terrible maps
05:36:37skrylari guess you actually can just export the layer to png/tiff and trigger krita
05:36:48skrylar3d coat offers this
05:36:53zacharycarterbut if that was all done in realtime so I could see the results of the maps being generated based on the UVs
05:37:04zacharycarterand the VUs autocorrecting manual mistakes
05:37:12skrylarwell the thing here is: the UV you paint does not need be the UV the engine uses
05:37:13zacharycarterthat'd be amazing
05:37:27skrylaras the mudbox user said you can bake ptex to an arbitrary UV
05:37:58zacharycarterhow does the latter come into fruition?
05:38:34skrylaryou would read the ptex file, find the image for any given quad, and render it? you can just get the gpu to do it
05:38:58skrylarsubmit the uv coordinates as a model and then texture those quads from the ptex image, submit the batch, repeat, read back the pixels
05:39:27zacharycarterokay I see
05:40:38*skrylar is in the conundrum of needing to write this bytecode crap for a contest project, or work on that SOAP thing to increase the odds of being paid to write nim code :x
05:41:51zacharycarterapply to status dude
05:42:00benjikunskrylar: sounds like the latter to me :)
05:42:10zacharycarterI have no idea what your ideal work / living situation is - but there's already solid Nim developers working there
05:42:44zacharycarterI didn't get the job w/ status but that's because of my lack of theoretical CS knowledge mostly and lack of data structure / algos
05:42:54zacharycarterI don't think you'd have any issues regarding that
05:44:15zacharycarterskrylar: if you want more info - PM me and I can get you in touch with their people / recruiters / other Nimmers working there
05:45:06zacharycarterthey're porting / optimizing the ethereum implementation from Golang to Nim and doing other cool things surrouding crypto
05:45:17zacharycarterall open source too
05:47:32skrylartip: i also have no formal CS education
05:47:53zacharycarterwell now you're just making me look bad :P
05:48:05zacharycarterI'm a history major - does that help my cause at all? :P
05:48:19skrylari didn't even go to high school ._.
05:48:28zacharycartergod damnit lol
05:48:34*skrylar GED :f
05:49:01skrylarhey at least you aren't doomed to repeat your mistakes.
05:49:08zacharycarterlololol
05:49:11skrylarlike taking history classes
05:49:32zacharycarterhistory repeats itself
05:49:45skrylarit has a tendency to do that. and people guard it so loosely.
05:50:02skrylarhad a conversation earlier about how police get away with little, journalists can interview mobsters, and archivists interview everyone.
05:50:20skrylarthe information is allowed inversely proportionate to perceived power, because people don't believe shaping the history record is a power
05:51:01zacharycarteryou need look no further than the current president of the US to find evidence to that fact
05:51:42skrylarit's not like ron paul was an option
05:52:02zacharycartershaping history / small hands
05:52:23zacharycarternot with that haircut
05:52:47zacharycarteroh I was thinking about his son
05:53:02skrylarpeople really were being unfair to the guy, although he has since earned some of it
05:54:41skrylarhaving a fun chuckle since currenlty reading The Road to Serfdom, at the same time this whole Guido von BDFL blowout is happening; and the book talks about how all things return to dictatorships because democracies are inept
05:54:49zacharycarterat least they're not deciding on the future of voxels vs polys
05:55:54zacharycarterwell - I don't even know what how you categorize the US's form of government
05:56:09skrylarbasically (at least in the book) democracies are inept at reaching decisions other than agreeing that everyone is mad about something. but solvingproblems, requires a Strong Man
05:56:28skrylarThink and Grow Rich talks about how successful man generally requiresa small council of good thinkers
05:56:50skrylarSo a small republic of apt persons are needed to run a community/project
05:56:51zacharycarteryou have corporate lobbyists running the show and career politicians - I don't think the creators of the concept of democracy could have envisioned the shit show
05:57:10skrylarthey did tho. east indie trading company?
05:57:20benjikunzacharycarter: Founding fathers experienced similar problems, just less amplified
05:57:21skrylarthe orignial model of the US had safeguards, we just ignore them
05:57:52benjikuna lot of the problems were philosophized by them, even
05:57:58skrylarbut i think its amusing to investigate the current backlash against bdfl's even though its the only model that works
05:59:11zacharycarterapt points for sure - I guess my only argument is it's a different world
05:59:21zacharycarterbut I agree - you need someone running the show who knows what they're doing
05:59:31zacharycarteror a small set of persons
05:59:38skrylarwell if you believe in Hobbs, people gravitate towards leaders
05:59:43*cspar joined #nim
05:59:44zacharycarterlook at how great Nim is
05:59:56zacharycarterI though it was all about people being naturally good vs evil
05:59:59zacharycarterhockes lobbes and all that
06:00:06skrylarthomas hobbes?
06:00:13zacharycarterhobbs
06:00:38zacharycartergd dyslexia
06:00:41skrylarpeople in general are crap
06:00:53zacharycarteryes I meant hobbes and lockes
06:01:11benjikunyeah 99% of everyone is incapable of making critical decisions
06:01:13zacharycarterbut you may have meant something totally different when you said Hobbs haha
06:01:17benjikunit's just genetic
06:01:39skrylarwell there is that thing attributed to aristotle that the mark of an educated mind is to hold a thought without believing in it
06:02:08zacharycarterdude - tell me about it - I had to call out the guy I work with every day today because for the past month it's been on me to figure out EVERYTHING regarding moving our software up through our environment chain
06:02:33zacharycarterthe guy I work with asks me if he can go to the gym. apologizes when he needs to use the rest room or go somewhere, etc
06:03:08benjikunapologizing for that isn't necessarily bad
06:03:13skrylardon't apologize for anything that you don't have to, but be ready to repent when you screw up :)
06:03:27skrylarrepentance is an interesting if misunderstood concept
06:03:38zacharycarterwhen we're "pair programming" and we run into something he doesn't understand he just floats off and starts working on crap he does understand and it ends up being me sharing my screen all day with him not paying attention
06:03:54benjikunlol
06:04:00zacharycarterapologizing isn't bad - but he doesn't need to ask me if it's okay with me to go on his lunch break or to go to the gym
06:04:04skrylarpair.. programming...
06:04:07*skrylar hands zacharycarter a pear.
06:04:58*dvn joined #nim
06:05:05skrylarhttps://cdn.discordapp.com/attachments/278558544146464778/427924853752987662/spode.jpg
06:05:32zacharycarterlol that is a cute ass spider
06:06:18zacharycarteralso your couch looks comfy af
06:06:28benjikunthere is a person I remember from high school named zachary carter
06:06:44zacharycarterdid you go to Oakton HS in Virginia?
06:06:49benjikunnope
06:06:51benjikunNorth Carolina
06:07:30zacharycarterwell - at least you live in a nice state :)
06:07:35Tangerzacharycarter, So, sounds like pair programming minus the "pair" part. Have you considered replacing him with a rubber duck?
06:07:37zacharycartermy parents are retiring down there
06:08:45zacharycarterTanger: lolol well when HTML / CSS / JS needs to be written he comes in handy - because honestly I can't devote the majority of my time to writing JS unit tests
06:09:02zacharycarterI'm too busy making sure the entire rest of our stack is functioning to worry about how our react VDOM is rendering
06:09:30benjikunw e b d e s i g n e r s
06:09:33TangerHey, I have people like that here too! The JS grunts
06:10:00skrylarunit tests are an important part of making sure you didn't feed the code spoders
06:10:02TangerJS isn't my cup of tea. But they always have free time to take on jobs
06:10:08benjikunI don't mind occasionally designing a front-end, but as for the people who solely live that as their job and can't do anything else -- pfft
06:10:13zacharycarterwe have no QA - we have to write / manage / deploy all of our own infrastructure and code on top of maintaining it all, we have no BA's and we have nobody to test our solutions in production
06:10:37skrylarthose are called customers, zacharycarter #leanstartup
06:10:40zacharycarterunit tests are great - except when like 99% of them are testing stupid ass javascript / reactd code
06:10:46TangerUAT === Prod, amirite?
06:11:06zacharycarterI wish
06:11:12zacharycarteroh and we have to interview potential hires too - but that's volunteer work
06:11:26TangerVolunteer work? 0_o
06:11:38TangerThat's dumb
06:11:45zacharycarterdude it's a show - they say you get to help interview candidates for your team!
06:11:47zacharycarterexcept we
06:12:04zacharycarter're so saddled with work that no one has time to do it - so it ends up being the same 3-4 people doing it over and over again
06:12:04TangerNobody volunteers due to work load, nobody gets hired to take work load, hence nobody can volunteer, etc, etc
06:12:22zacharycarterthere was a few months where 25% of my time at work I was interviewing / involved in the hiring process of candidates
06:12:29zacharycarteras a developer
06:12:37skrylarjust do what game developers do and never hire anyone
06:12:41TangerSounds like a good waste of your time
06:12:42skrylarlol
06:12:44TangerHaha
06:12:50zacharycarteryeah so I just stopped doing it and now there's only like 1-2 people that volunteer and no one gets interviewed
06:13:33zacharycarterI'm thinking about becoming a game developer - sole proprietorship - I'm not going to do any work, I'm just going to say I'm going to release some awesome game in the future, launch a kickstarter, and drink beer
06:13:51TangerSeems to have worked for people so far
06:13:57zacharycarterI'll hop into photoshop / bryce / 3dsmax on occasion
06:14:07zacharycartercook up some cool asss fake screenshots
06:14:08skrylarzacharycarter, the tim schafer package requires a slight amount of pre-existing rep to start that plan with
06:14:12TangerProgress update: I polished off 2 cartons yesterday, for inspiration
06:14:22zacharycarteryeah exactly
06:14:35zacharycarterI'm pretty sure I could even replace polishing off cartoons with jerking off
06:14:38skrylari wouldn't nkow what to do with the money
06:14:39zacharycarterand I could still get away with it
06:14:49skrylarlike, a guy actually is posting things to my github and i'm like o__o
06:15:02skrylari know a coder monkey but he's.. eugh.
06:15:02zacharycarterI had this amazing JO session yesterday - I came up with so many new and great ideas - this will be AMAZING!
06:15:12zacharycarteralright guys - give me $$$
06:15:39skrylarjust attempt to make something so glorious that you fail spectacularly
06:15:59TangerNo Man's Sea?
06:16:02TangerNo relation
06:16:11zacharycarterlol
06:16:18skrylarsunless seas in full 3d
06:16:26zacharycarterI've tried to do this with Nim
06:16:47skrylari dunno. i tried reading how to make a "casual RTS"
06:16:50TangerHow are Nim's game engines like?
06:16:54skrylarturns out its called halo wars 1
06:16:55zacharycarterbut then someone asks me about aws / kubernetes / some other bullshit enterprise tech and I have no answer
06:17:56zacharycarterwhen Nim gets a propper game engine - I will support the hell out of it / buy it / build stupid games with it
06:18:27skrylardid you know that programming an RTS is the same thing as killing yourself? true story
06:18:32*skrylar hides under the piles of pathfinding papers
06:18:37zacharycarterlol
06:19:05zacharycarterI spent a good two weeks fucking with OpenGL / Shaders to figure out how to make a unit circle
06:19:15zacharycarterand I didn't even come close to figuring out how to merge them
06:19:41skrylarpaint them on a separate layer and run a convolution pass to find the edges?
06:20:40skrylari guess there might also be hijinks with painting the interiors on the stencil buffer and then painting the outer circles with a stencil test
06:20:47skrylarthats probably cheaper
06:20:50zacharycarteralthough - https://github.com/a-nikolaev/curseofwar
06:21:14zacharycarteryeah - I just didn't know how the stencil buffer worked
06:21:37zacharycarterI did have some awesome 2d isometric rendering going on in my nim game engine though
06:22:16skrylari saw halo wars 1 on youtube and did some reading; it' eeh
06:22:24skrylarwell simple rts games tend to just be spam to win
06:22:59zacharycarterAraq's dream is to have a RTS written in Nim
06:23:08zacharycarterthe problem with RTS games is - you need tons of graphics
06:23:21zacharycartera RPG using FLARE open source graphics would be much easier to write in Nim
06:23:39zacharycarterso that's probably the direction I'm going to go in with my next game / engine project
06:24:04zacharycarterI spent a good month or two looking for open source RTS capable graphics to make a RTS with
06:24:24skrylarthere was a set of those that were old amiga pixel art
06:24:26zacharycarteryou can't use anything you buy on the unity / UE4 stores in open source projects
06:24:40zacharycarteropen game art is a shit show when it comes to open source RTS graphics
06:25:39zacharycarterhttp://flarerpg.org/ - is totally open source and the graphics are GPL so I think I'm just going to make a dumb RPG diablo sytle next time I approach a game w/ Nim
06:26:00skrylargraphics are not insurmountable
06:26:12skrylarpeople play dominions and those are largely static sprites
06:27:46zacharycarteryeah but overcoming that takes creativity
06:27:50zacharycarterwhich I am also horrible at
06:28:18zacharycarterhttps://britzl.github.io/Warbattles-RTS/
06:28:23zacharycarterthat was the other one
06:28:33skrylarconstraining the scale is an issue; how big are the maps, squads (CoH/DoW) or single units (Spring)
06:28:37zacharycarterand when I showed those graphics to Araq I think he puked
06:29:45zacharycarterI don't really posess the creativity genes for making an awesome new game concept or killer graphics
06:30:04FromGitter<survivorm> Didn't he played dune?
06:30:11FromGitter<survivorm> long-long ago ^)
06:30:16zacharycarterI'm more of a, tell me what needs to get done and I'll figure out how to do it - kind of person
06:30:24zacharycarterso cobbling together a game framework that can run a stupid small RTS is feasible
06:30:40skrylari wonder how obedient raylib is
06:30:54skrylarlike if you can just shove its rendering bits in pre-existing opengl contexts
06:30:55zacharycarterdon't use raylib
06:31:00zacharycarterthat dude has no idea wtf he's doing
06:31:14zacharycartermyself / others have found major flaws in his OpenGL calls
06:31:15skrylarbut i dont wanna bind allegro again
06:31:22zacharycarterlike he goes against the OpenGL spec in several ways
06:31:27zacharycarteruse BGFX
06:31:36skrylarbgfx doesn't let me shit sprite batches
06:31:38skrylarallegro does
06:31:41zacharycarterand use the renderer I will eventually write
06:31:50zacharycarterI can give you a sprite batch for bgfx
06:31:55zacharycarterI've written one before
06:32:40skrylarthere are actually a ton of design troubles with strategy games
06:32:47zacharycarterthere are tradeoffs to everything - you will not get the optimal render loop you want and you will want to rewrite it at some point anyway I promise
06:32:53zacharycarterbut CSMFL is your best bet
06:33:11zacharycarteror godot
06:33:34zacharycarterfirst thing Nim needs is a cross platform windowing library
06:33:59zacharycarterbut if we don't have that - we can rely on someone that's already written a minimal one to work with their graphics API like BGFX has
06:34:18zacharycarteror you can just take BGFX and combine it with CSFML and just use the CSFML windowing code and ditch everything else
06:34:23zacharycarterBGFX just really cares about the render loop
06:34:47skrylarwell, design issues are more daunting than ther est. the other problems are 'solved' although they require yak shaving and typing
06:35:05zacharycarterbut at that point - writing a sprite batch is easy and there are examples of ones already written using BGFX / one I can provide
06:35:24skrylari remember trying to play Dawn of War 2 with the elite mod community, and it was a very unwelcoming experience
06:35:44skrylarnobody would help you out, and the game is full of "if this race v. that race, use this build or lose hard."
06:36:13zacharycartersounds like a bad MMO
06:36:45zacharycarterthe thing about Nim and SMFL / SDL2 / etc... is this
06:37:09zacharycarterNim handles GC / threading in a very unique manner vs how these libraries expect it to be handled
06:37:27zacharycarterso if you bind yourself to one of these windowing libraries that takes control of threading for you
06:38:01zacharycarteryou're stuck to a single thread essentially in your game execution - otherwise you're going to be dealing with a shit show of undefined behavior
06:38:34skrylarthere's also "fun" problems like stream economies vs. cash economies ;p
06:38:38zacharycarterwhat I think is the most logical approach is to take all the window / system code out of a lib like SMFL
06:38:57zacharycarterand then use that to write your own lib / framework with
06:39:14zacharycarteruntil Nim gets a stable game "engine" "framework" "library" whatever
06:39:41zacharycarterbecause at this point - beyond myself and Krux02 all people have done is written SDL games / SMFL games with Nim
06:40:06zacharycarterthere's zero exploration into a 3d game engine with a propper editor, etc...
06:40:31zacharycarterif we can get to that point - we'll have something D / Rust doesn't have
06:40:57zacharycarterthere's already plenty of example code demonstrating how to do it in C/C++ with libs like ImgUI
06:41:09zacharycarterwe have Nuklear bindings - we should be able to do the exact same thing with Nim
06:41:45zacharycarterthe only question myark in my eyes is the parallelzation / job scheduling system most game engines feature today - but I've brought this up with Araq consistently and he's pointed me towards async tasks
06:42:42zacharycarterso we should be able to build something akin to Godot in pure Nim without too much effort if we just reuse already existing C/C++ libs
06:42:52zacharycarteryes - we may have to write our own rendering subsystem., virtual filesystem etc - but that's where the fun comes into play when writing a game engine anyway
06:43:12skrylarthose are unfascinating topics
06:43:15zacharycarterwe have the distinct advantage of being able to rely on a robust amount of C code that already does all that crap for us
06:43:27zacharycartermeh - I'll do them
06:43:31skrylari really can't do anything better than physfs
06:44:21skrylarrolling your own glfw is not really hard, it's just tedious
06:44:24zacharycarterI'll write the renderer - you just give me the shit I can't do math wise like animation easing and physics / IK constraints :P
06:44:33zacharycarterwe don't need to roll a glfw
06:44:47skrylar"windowing library" thats exactly what glfw IS
06:45:05zacharycarterwe can just steal the window / sys code from SFML which is already written in C
06:45:15zacharycarterthe big thing is the renderer, the VFS and resource loading
06:45:32zacharycarteryeah but keep in mind glfw has no mobile support
06:45:38zacharycarterSFML does - so does SDL2
06:46:25zacharycarterSFML does what SDL2 does minimally - SDL2 has a lot of other crap added on top through extensions
06:46:51zacharycarterbut at the bare minimum SFML provides windowing, input, system access and basically everything you need to build a game
06:47:02zacharycarterand you don't need to use their renderer / graphics stuff
06:48:49FromGitter<tim-st> Can it be possible to use a syntax like `raise ValueError("error msg")` or `raise ValueError` with this: https://github.com/nim-lang/Nim/issues/8363
06:49:16FromGitter<tim-st> just thought about if overloading would work
06:49:52*PMunch joined #nim
06:51:06zacharycartertim-st: add a comment to the issue - no harm in suggesting an idea
06:51:27zacharycarterI don't know if any of us currently chatting are that familiar with the issue you linked to
06:51:58FromGitter<tim-st> dont want to destroy it^^
06:53:06zacharycarterDon't be afraid to ask questions / propose ideas - you may get rejected but I think the community would much prefer involvement over the lack thereof
06:53:17FromGitter<tim-st> ok
06:53:34zacharycarterIMO - if you have an idea or a suggestion on an issue in the github repo - post away
06:54:14zacharycarterthe worst thing that can happen is you'll get rejected / mocked - but that happens to most of us every day I think so take it with a grain of salt
06:54:42FromGitter<tim-st> ok, then I dont post it :D
06:54:50zacharycarterI think anyone contributing to Nim in any sense of the word is valued by anyone that cares about the language
06:55:43zacharycarterhahaha - don't be afraid! people might bite but it's just internet bytes!
06:56:15FromGitter<tim-st> just read it again maybe it's already in the text and I didnt see
06:57:25zacharycarterit is a long ass RFC
06:57:39zacharycarterI love it though - thanks for bringing it to the channel's attention - had no idea this was a thing in motion but it's a good thing I think!
06:58:13zacharycarterand I can now stop pretending I know why python can catch these exceptions and treat them non fatally while Nim cant!
06:59:00skrylardoesn't relying on enums for errors kind of brick user defined errors
06:59:07FromGitter<tim-st> yes, sounds quite good, if it's easy to use like before I like it
07:04:46*yglukhov[i] joined #nim
07:05:24zacharycarterskrylar: yeah - good point - I don't know how this would interfere with the current implementation of user defined exceptions
07:05:56*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/cyidFtavuOujVJVMfhDEgKDc >
07:05:59FromGitter<rayman22201> Thats
07:06:21skrylarusing one big enum is normal for embedded runtimes, but they usually add custom exceptions to said enum
07:06:48FromGitter<rayman22201> Lol. That's the rfc I was talking about when I was online earlier
07:07:34FromGitter<rayman22201> @tim-st the problem with
07:08:02FromGitter<rayman22201> Ugh... Mobile hitter client fail
07:08:11FromGitter<tim-st> ^^
07:08:18zacharycarteryeah - I had no context haha but it all makes sense now :P
07:08:37zacharycartersupervisor concept sounds crazy
07:08:40FromGitter<rayman22201> The problem with raise("error") is that it has to allocate that string somewhere
07:09:06FromGitter<tim-st> ok, but how would the new way look then?
07:09:07*zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/pVCYWuOOOxdYlAiBgCddgxfv >
07:09:19FromGitter<tim-st> and const strings doesnt need to be allocated?
07:09:23zacharycarterdoes not look like something I want to write
07:09:31FromGitter<rayman22201> @skrylar Good question about user defined exceptions though
07:09:56zacharycarterconsts are compile time constants right?
07:10:12FromGitter<tim-st> Isnt that the "exception hierchachy"? if so Araq said yesterday it isnt supported
07:11:28FromGitter<rayman22201> Const string would be OK.
07:13:14*roboxnik joined #nim
07:15:51FromGitter<rayman22201> @zacharycarter yeah. Const == compile time constant
07:20:05skrylari think what i once read is that they pre-allocate the out of memory error
07:20:15skrylarso it can always be thrown no matter what
07:21:43*roboxnik quit (Remote host closed the connection)
07:21:49*jjido joined #nim
07:22:13*roboxnik joined #nim
07:23:11*roboxnik quit (Client Quit)
07:23:38FromGitter<tim-st> ok, that's good
07:25:01skrylarwell, i don't know that araq is doing that
07:25:05skrylarbut some embeddeds do
07:28:18FromGitter<rayman22201> @skrylar off-topic and late, but I'm glad someone else likes 3D coat. I always thought it was cool software... Though the company is a bit much with their religious beliefs in their marketing.
07:29:26skrylarthey removed that clause from the eula
07:30:09skrylarI don't have much to say wrt. political or religious developers. one really can't separate the two
07:30:11TangerWhoa, so they are
07:30:18FromGitter<rayman22201> Good to know. That was a big controversy if I remember
07:30:26Tanger"We would be really happy if 3DCoat could be used to create beautiful works of art to inspire and bring joy, and not provoke hatred, aggression to people, wizardry, witchcraft, addiction or carnality."
07:30:35TangerWizardry and witchcraft?
07:30:46skrylarthe guy who wrote it allegedly had a big problem with sex addiction and depression
07:31:23FromGitter<rayman22201> I'm not judging
07:31:24skrylarwe aren't all machiavelians :p
07:31:42skrylarhttps://openpsychometrics.org/tests/MACH-IV/
07:31:43FromGitter<rayman22201> Lol
07:32:42skrylari used to joke about having conditional licensing like 'if your product has online activation / steam exclusive then you pay 5,000$ a seat, otherwise its like 20$'
07:32:49skrylarthe more you hate humanity the more you pay :e
07:36:35FromGitter<rayman22201> Hahaha
07:37:54*jjido quit (Ping timeout: 256 seconds)
07:41:46skrylarkind of want a nim version of loomio
07:41:49Araqskrylar: if we do that. it means every program starts with a heap allocation in order to support throwing OOM.
07:42:16skrylarAraq, you can't just bullshit the exception from the constant section?
07:42:25AraqI know I wrote code to do just that but tbh I don't know how it's done today
07:42:47Araq'ref' is never from a constant section, the GC assumes it can collect it.
07:43:25skrylaredge cases are suffering
07:48:43*Vladar joined #nim
07:53:12*gangstacat quit (Ping timeout: 256 seconds)
07:57:21FromGitter<tim-st> Araq: does it mean something like `raise ValueError(stringVar)` doesnt work?
07:58:24FromGitter<Bennyelg> hey, anyone know how I define path to nim only on the user workspace on vscode ?
07:58:38FromGitter<Bennyelg> custom path *
07:59:13*Guest51560 is now known as euantor
07:59:36*euantor quit (Changing host)
07:59:36*euantor joined #nim
08:03:08*gangstacat joined #nim
08:03:13*gangstacat quit (Remote host closed the connection)
08:03:48*gangstacat joined #nim
08:07:08*cspar quit (Ping timeout: 276 seconds)
08:07:43Araqtim-st: that doesn't work today either and much code still uses 'raise newException(ValueError, "foo")' which will continue to compile
08:19:25FromGitter<tim-st> yes, I meant could hat syntax be possible with the new approach?
08:22:46FromGitter<Araq> nah, it's not part of this proposal.
08:22:59FromGitter<Araq> in fact, no syntax change is proposed.
08:23:20FromGitter<tim-st> this wouldnt be a change or?
08:24:00FromGitter<Araq> if ValueError is an enum value, ValueError(stringvar) cannot work
08:24:30FromGitter<tim-st> that's what I assumed, can it be pure enum, does it work then?
08:25:00FromGitter<Araq> what has that to do with anything
08:25:00FromGitter<tim-st> hm, pure enum for exception is not cool
08:31:15FromGitter<gogolxdong> compile gSOAP got cannot find -ly , what is it exactly?
08:51:10skrylarthat is yacc's runtime library
08:51:46FromGitter<mratsim> @gogolxdong, @zacharycarter Py2nim worked for porting part of Py-evm https://github.com/ethereum/py-evm to Nimbus
08:52:04FromGitter<mratsim> you have to ask @alehander42 if it does not compile anymore though
08:53:36FromGitter<mratsim> Note that we recently refactored a lot of ported code because the Python codebase was a bit heavy-handed on object orientation, which is not really suitable for a virtual machine (the Ethereum VM)
08:55:16*leorize joined #nim
09:13:49*cspar joined #nim
09:14:59FromGitter<gogolxdong> Thanks for reminding , I think we have to figure out how gSOAP and SOAP works first, then omit the necessary of translating auto generated flatten python type code to nim .
09:47:09FromGitter<Varriount> araq: Looking at the C++ std::error proposal, the `error` datatype takes up two pointers - one for a pointer, and one for a domain (which I guess is a indicator of the type of the error). You mentioned that Nim's model will be different - that there will only be an enum value?
09:55:02*leorize quit (Ping timeout: 276 seconds)
10:07:32*leorize joined #nim
10:23:03FromGitter<Araq> yes. and even that is already over-engineered, in today's stdlib IoError and OsError are pretty much interchangeable.
10:28:13*Yardanico quit (Quit: Quitting)
10:31:05FromGitter<Araq> let's consider `MyError = object of IoError`. Firstly, this means it's an IoError, that's enough to know in order to be able to handle this error. Secondly the proc that exposes that `MyError` in practice calls proc foo which raises an `IoError` and then its signature becomes `.raises: [MyError, IoError]` (which is technically the same as `.raises: IoError`) or it really does a fancy translation step from any exception to
10:31:05FromGitter... its custom `MyError` exception. This translation step is rarely done in practice and if it is, it would be harmful as it also would probably transform `ValueError` to `MyError` too (which was not an IoError).
10:33:35*Yardanico joined #nim
10:35:03*stefanos82 joined #nim
10:45:02*xylef quit (Quit: WeeChat 2.2)
10:50:30*xylef joined #nim
11:08:17*cspar quit (Ping timeout: 248 seconds)
11:17:17*BitPuffin joined #nim
11:25:01*yglukhov[i] quit (Read error: Connection reset by peer)
11:25:33*yglukhov[i] joined #nim
11:34:43FromGitter<Varriount> Araq: What about the case where that translation is needed?
11:36:25FromGitter<Varriount> For example, the Python AWS library boto3 has a ClientError type, which wraps HttpError and adds information about API calls that failed.
11:37:16FromGitter<Varriount> It seems like this new exception architecture prevents that from being easily possible.
11:40:28FromGitter<Araq> it's just a ProtocolError with some additional info somewhere.
11:40:41FromGitter<Araq> and as usual, the additional info is purely debugging-related.
11:44:39FromGitter<Varriount> There are non-debugging cases - for example, an client handling an http 404, or some other specific error code.
11:44:45FromGitter<Varriount> Does this new architecture allow references to that information to be kept?
11:46:17FromGitter<Araq> http is yet another example that does well with a fixed number of error codes.
11:47:36FromGitter<Araq> any successful error handling model lists the possible error codes, it's the "extensibility" aspect that does not work at all.
11:51:29FromGitter<Varriount> There are times when extensibility is needed.
11:57:12FromGitter<Araq> yeah and you simply can't name these times, right?
11:57:39FromGitter<Varriount> I can.
11:58:10dom96There are many protocols that are built on HTTP
11:58:18dom96And they can use non-standard error codes
11:58:45FromGitter<Varriount> Also, C code too.
11:59:35FromGitter<Araq> yeah and they are all mapped to a fixed set of error cases.
12:00:03FromGitter<Araq> like the `MyError` example that *is* an `IoError`.
12:00:29FromGitter<Varriount> dom96, araq: My favorite is when the protocol just returns a successful http code for all errors, but places the actual error information in the response.
12:01:46FromGitter<Varriount> Also, what if I want to achieve details with an error, for logging purposes?
12:01:53dom96This RFC is depressing
12:02:08FromGitter<Araq> then you get the error message.
12:02:49FromGitter<Varriount> Araq: But from what I've heard, essentially the error is an enum.
12:03:11FromGitter<Varriount> dom96: Where is the RFC?
12:03:16dom96https://github.com/nim-lang/Nim/issues/8363
12:03:21FromGitter<Varriount> I've just read the post on the forum.
12:04:25FromGitter<Varriount> Hm, that RFC essentially looks like C error codes.
12:08:30*enthus1ast joined #nim
12:12:31dom96I replied with a possibly less disruptive solution
12:15:52FromGitter<Varriount> Araq: I essentially have the same arguments as andreaferretti - Yes, *most* of the time extended information is used as a debugging aid, however there are situations (such as the aforementioned HTTP protocols) where its not known ahead of time what exactly the error will be. Furthermore, extended information is vital when analyzing failures in a production system.
12:16:59dom96I don't know much about how exceptions work internally. But my suggestion is to allow raising object's allocated on the stack.
12:16:59*nsf quit (Quit: WeeChat 2.1)
12:18:30enthus1astany suggestion to fix this? https://gist.github.com/enthus1ast/13a7e9b8af865cfc5afe685b9f130ca4
12:19:53enthus1astthis fails with "Error: ordinal type expected"
12:19:54stefanos82Araq: is the reason for replacing future with sugar as a pun for "syntactic sugar"?
12:21:06dom96stefanos82: yes
12:21:27stefanos82dom96: very nice.
12:23:52FromGitter<tim-st> enthus1ast: it does only work if you remove the explicit valued from your enum
12:24:25FromGitter<tim-st> I think it's because the bitset needs special numbers that are created by compiler but maybe I'm wrong
12:24:53enthus1asttim-st i know, but i still wonder why its not possible (now), it was working
12:25:27enthus1ast(i know that it works withouth the xFF)
12:25:58FromGitter<tim-st> maybe as a workaround create all missing enums with default ones such that the values fit^^
12:26:10FromGitter<tim-st> I think it's a bug
12:26:18FromGitter<Araq> @dom96 thanks for your input, I replied and I now have an even better idea... *cough*
12:27:23FromGitter<Araq> @enthus1ast the enum is clearly not an ordinal, but I am thinking of allowing enum with holes in the set construction
12:28:04enthus1astAraq: it was working a few month ago
12:29:13enthus1astor better is enum the right datatype for what i do here? :)
12:30:32FromGitter<tim-st> I would delete the `.byte` from the enum values I think it has no effect
12:30:46stefanos82I may sound like a complete goof right now, but I have seen some Nim excerpts that have two # comments. Are there any different than normal single # comments?
12:31:58enthus1aststefanos82: lines with ## will show up in nim docs
12:32:11stefanos82ah cool, I didn't know!
12:33:47FromGitter<Araq> so ... I could now edit my RFC but then the comments would refer to an outdated version
12:34:33FromGitter<Araq> should I just reply, listing my differences?
12:34:55FromGitter<kaushalmodi> @Araq You can keep the older RFC untouched.. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50856f55a7e23c015174c1]
12:35:32FromGitter<kaushalmodi> in the v1 portion, strikethrough (`~~foo~~`) all the now not relevant stuff
12:39:25PMunchIs there a way with unit tests to check if it echos something?
12:43:52FromGitter<Araq> @kaushalmodi ok, thanks
12:45:27*skrylar quit (Ping timeout: 240 seconds)
12:45:36FromGitter<codem4ster> Hi folks, I'm trying to learn futures in Nim, and it looks like promises in javascript, I think.
12:46:13FromGitter<codem4ster> I tried something like this, without luck ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508815a94c525552417414]
12:47:30FromGitter<codem4ster> I'm trying to print James Bond asyncly in 3000 millisec and want to stop the main program 1sec after this
12:47:44FromGitter<codem4ster> how can I achieve this with
12:49:48FromGitter<Yardanico> @codem4ster there's "sleepAsync" for sleeping in async procs, and your example can be done simpler I think
12:53:08*xylef quit (Ping timeout: 276 seconds)
12:54:31FromGitter<codem4ster> could you provide a running code for my example?
12:56:29FromGitter<Yardanico> @codem4ster ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ But you wouldn't write code like that in real async app [https://gitter.im/nim-lang/Nim?at=5b508a7d623cc3040b2fffcb]
12:56:54FromGitter<Yardanico> because usually you would have a main proc which will call all other needed procedures with `await` or `asyncCheck`
12:58:12FromGitter<Yardanico> like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508ae41539a7040cebd3b4]
12:58:52*nsf joined #nim
12:59:28FromGitter<Yardanico> oh, and quit() call is optional here
12:59:28FromGitter<codem4ster> I know. I just trying to understand Future behaviors.
12:59:55FromGitter<Yardanico> @Araq btw, is this a bug or intended behaviour: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508b4bad8d085553b027f4]
13:00:28FromGitter<Yardanico> @codem4ster in async procs you should use "await sleepAsync(ms)" to sleep in current async proc (and let other async procedures do stuff)
13:00:49FromGitter<Yardanico> os.sleep(ms) is blocking, it will block the entire program and stop all async procedures until it completes
13:01:40FromGitter<codem4ster> hmm, got it. So then, async functions isn't running inside another thread?
13:02:14FromGitter<Yardanico> no, they're running in the same thread
13:02:46FromGitter<Yardanico> however you can actually have multiple async dispatchers in different threads (like httpbeast does for example)
13:03:27FromGitter<codem4ster> then asynchttpclient is handling requests in main thread?
13:03:38FromGitter<Yardanico> you mean `asynchttpserver`? yes it does
13:03:47FromGitter<codem4ster> ahh sorry, yes
13:03:56FromGitter<Yardanico> async in nim is implemented via iterators and `async` macro
13:04:44FromGitter<codem4ster> it looks like fibers in crystal
13:05:17FromGitter<Yardanico> well, I didn't code in crystal so I don't know, but for me async in nim is almost the same as in Python (because I've used async in python before)
13:06:39FromGitter<Yardanico> there are channels in nim for thread communication btw
13:06:58FromGitter<Yardanico> but usually for IO stuff you will use async
13:07:10FromGitter<Yardanico> for IO-bound programs I mean
13:07:47enthus1astwith stdin as a exception
13:07:55FromGitter<codem4ster> Got it. I want an http server that supports parallelism, for speed reasons.
13:08:25FromGitter<Araq> then use httpbeast.
13:08:27FromGitter<Yardanico> `httpbeast` is async and multithreaded :)
13:08:38FromGitter<Yardanico> also there's `mofuw`
13:09:06FromGitter<Yardanico> @codem4ster https://github.com/dom96/httpbeast, https://github.com/2vg/mofuw
13:09:12FromGitter<codem4ster> I tried mofuw but it didn't respond to apache ab tests in windows10
13:09:31FromGitter<Yardanico> oh, you're on windows
13:09:41FromGitter<codem4ster> no I'm on multiplatform
13:09:43FromGitter<codem4ster> :D
13:09:56FromGitter<Yardanico> httpbeast doesn't support windows :)
13:10:29FromGitter<codem4ster> hmm interesting. Why? Nim is cross platform.
13:11:01FromGitter<Yardanico> well, it doesn't mean that all programs will be cross platform
13:11:03dom96because almost everyone uses linux on servers
13:11:45euantorit would be awesome to have Windows support though - Nim's standard library support for Windows is one of it's big plus points to me
13:11:49Yardanicodom96, btw, that means that jester doesn't work on windows anymore?
13:11:50enthus1astmost servers i had to support where windows
13:11:56enthus1astjust saying
13:12:15dom96Yardanico: nope, it falls back to asynchttpserver
13:12:19FromGitter<codem4ster> I'm using linux on my server too, but on my job I want to play with Nim ecosystem. And its windows. :D
13:12:21Yardanicook, that's good
13:13:01dom96I don't have a Windows machine right now so I don't have much ability to implement Windows support for httpbeast
13:13:26Yardanico@codem4ster is it windows 10?
13:13:35Yardanicoif it's windows 10, why not just use WSL
13:13:37FromGitter<codem4ster> yep
13:13:48FromGitter<codem4ster> WSL?
13:13:54Yardanicowindows subsystem for linux
13:14:00dom96Also, Windows requires a completely different approach
13:14:16FromGitter<codem4ster> ahh I personally don't like that
13:14:20Yardanico@codem4ster
13:14:20Yardanico<FromGitter> <codem4ster> WSL?
13:14:22Yardanicooh sorry
13:14:27Yardanicohttps://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
13:14:46FromGitter<codem4ster> it performs slow, so I don't benchmark things well.
13:14:54YardanicoIO is slow, CPU is good
13:15:23FromGitter<codem4ster> and the another point is testing cross platform :)
13:16:07FromGitter<codem4ster> ok not so important. I have a VM on job. I was just curious about windows support.
13:18:18FromGitter<codem4ster> I also tested Jester's simple example with my VS code, but it hangs with "Indexing: 1" at the bottom right.
13:18:37FromGitter<codem4ster> may be because I'm on a windows platform.
13:18:57PMunchHmm, is there a way to properly overwrite !=
13:19:14PMunchI have some issues where it uses == instead and just negates the result..
13:19:15Yardanico@codem4ster it works fine for me
13:22:33euantor@dom96 Would it be a good diea to have an issue on httpbeast describing which parts don't work with Windows to see if there are ways around them?
13:23:07dom96Not really
13:23:16dom96Windows is fundamentally different
13:23:31FromGitter<codem4ster> Could you please share a code about parallelism in Nim? I want to make 2 threads one of them increases `i`by 1 every 1sec, and one of them decreases `i` every 2sec.
13:23:34dom96So much so that I would say it would be better to have a separate project for it
13:23:44FromGitter<Yardanico> @codem4ster I doubt that this is possible
13:24:04FromGitter<Yardanico> well, it is, but you will need to use pointers
13:24:10FromGitter<Yardanico> threads in nim have thread-local GC
13:25:10FromGitter<Yardanico> well, I'll try
13:26:39dom96That seems like a completely arbitrary and artificial task
13:26:48dom96What are your actual use cases for threads?
13:27:41*couven92 joined #nim
13:28:19FromGitter<Yardanico> well, it works : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5091f38fe2780689c42b2b]
13:28:54FromGitter<codem4ster> ah grrreaat. I will test now :D
13:29:59FromGitter<codem4ster> Error: undeclared identifier: 'Thread'
13:30:33FromGitter<Yardanico> @codem4ster you need to compile with `--threads:on` as stated in documentation
13:31:14FromGitter<Yardanico> some info: https://nim-lang.org/docs/threads.html, https://nim-lang.org/docs/threadpool.html, https://nim-lang.org/docs/manual.html#parallel-spawn
13:31:34*endragor quit (Remote host closed the connection)
13:32:04*endragor joined #nim
13:32:16FromGitter<codem4ster> thank you very much @Yardanico, it works in windows also :D
13:32:37FromGitter<Yardanico> yes, threads are cross-platform
13:33:29FromGitter<codem4ster> is Nim prevents deadlocks on `i`?
13:33:50FromGitter<Yardanico> probably not, there are locks for this
13:33:57FromGitter<Yardanico> I don't really use threads in Nim so I can't answer for sure
13:35:39FromGitter<codem4ster> I tested it doesn't give into a deadlock. That's great. :D
13:35:57Yardanicobut you should probably use locks anyway :)
13:36:03FromGitter<codem4ster> just remove sleeps and try :D
13:36:21Yardanicoand you don't need to always use threads explicitly, I linked manual which explains parallel/spawn
13:36:27*endragor quit (Ping timeout: 240 seconds)
13:39:09FromGitter<codem4ster> I asked this for parallelism at first :(
13:40:02FromGitter<codem4ster> but I think sharing variables between processors is a harder task
13:41:09FromGitter<Yardanico> what do you mean?
13:41:27FromGitter<Yardanico> threads in nim are like real system threads, they can run at different processor cores
13:43:53FromGitter<codem4ster> hmm, in Ruby parallelism and concurrency is different things.
13:44:27FromGitter<codem4ster> Ruby parallelism is forks and concurrency is threads
13:45:05FromGitter<codem4ster> threads are opening only in the same core of the main program
13:45:42FromGitter<Yardanico> Ruby has gil like python, that's why
13:45:50FromGitter<Araq> that's called a "global interpreter lock" and is nothing to boast about.
13:46:20FromGitter<codem4ster> I always thought threads always must work on the same core :) What a shame.
13:46:48FromGitter<codem4ster> thanks for your helps now I love Nim 2x more :P
13:49:17FromGitter<codem4ster> @Araq you mentioned about elm architecture on your previous posts
13:49:19FromGitter<tim-st> can I create a specific proc only for a specific kind of a object variant? or should I test this myself using assertions?
13:49:58FromGitter<codem4ster> but thats more about frontend and SPA applications
13:50:06FromGitter<tim-st> @codem4ster I also only found out about this a few days ago^^
13:50:38FromGitter<tim-st> but there cant share memory if I understood correct
13:50:41FromGitter<Yardanico> @codem4ster nim can be used as a frontend
13:50:42FromGitter<tim-st> *they
13:50:59FromGitter<Yardanico> @tim-st you can share GC'd memory AFAIK
13:51:07FromGitter<Yardanico> oh sorry
13:51:09FromGitter<Yardanico> *you can't
13:51:22*dddddd joined #nim
13:51:23FromGitter<tim-st> what means gced mem? all ref types?
13:51:25FromGitter<Yardanico> But you can share non-GC'd memory like in the example above with two threads and one global `i` int
13:51:45FromGitter<Araq> @tim-st you can do this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5097714b583a74a729aa97]
13:52:13FromGitter<tim-st> @Araq thanks, that makes sense!
13:53:29FromGitter<tim-st> but I think it has overhead when I create one object type for each kind
13:53:35FromGitter<Araq> @codem4ster I wasn't really serious, but when you have an SPA, the backend becomes simple enough to not require MVC. IMO anyway, but then I never understood MVC to begin with.
13:53:48FromGitter<codem4ster> yes @Yardanico I know but I will not use Nim for this purpose never I think. I tried ruby to javascript compiler -Opal- before (best implementation I ever see) but this type of implementations increase the js size dramatically. I looked at Nim compiled js and didn't satisfy the size of the js. :(
13:54:12FromGitter<Yardanico> well, you need to compile via `-d:release `and JS size will not grow dramatically with more stuff
13:54:26FromGitter<Araq> the produced JS is good and will only get better.
13:54:56*endragor joined #nim
13:55:07FromGitter<codem4ster> I examine the snake game. Is that compiled with -d:release ?
13:55:15*TheLemonMan joined #nim
13:56:13FromGitter<Yardanico> let me see..
13:56:21FromGitter<codem4ster> https://picheta.me/snake/ this is not a good.
13:57:20FromGitter<Yardanico> it's not in release mode lol
13:57:36TheLemonManAraq, give a look at #8095 when you have some time, we need some (breaking?) changes to winlean
13:57:49FromGitter<Yardanico> @codem4ster because it's not compressed
13:57:56FromGitter<Yardanico> you can use clojure compiler to minify js
13:58:57*endragor quit (Ping timeout: 240 seconds)
13:59:12FromGitter<codem4ster> you misunderstood. :) I mean too much non DRY un-optimised code in there.
13:59:27FromGitter<codem4ster> I know its not a compressed one :P
13:59:37TheLemonManhmm, if I leave src/mylibname.nim
13:59:45TheLemonManehh, ignore that
14:00:09FromGitter<Yardanico> @codem4ster but resulting JS code is not meant to be read by real people
14:00:32FromGitter<Yardanico> and I get ~224kb in release mode with snake game, is that bad? I don't think it is
14:00:36FromGitter<codem4ster> I'm looking for the filesize not readability :(
14:00:41FromGitter<Yardanico> and that's without any compression/clojure compiler
14:01:06FromGitter<Yardanico> forum.nim-lang.org uses nim as a frontend as well
14:01:14FromGitter<Yardanico> https://forum.nim-lang.org/
14:01:18FromGitter<codem4ster> may be I can give chance, and gather data about js side.
14:02:11FromGitter<codem4ster> I must test it with my very own code. But I must say its smaller than OPAL in size.
14:03:32*chopzwei joined #nim
14:04:01FromGitter<Yardanico> oh, and snake.js is only 35kb (because picheta.me uses cloudflare)
14:04:08FromGitter<Yardanico> I mean it's 35kb to download for the client
14:04:32FromGitter<codem4ster> gzipped version?
14:04:47FromGitter<Yardanico> brotli'd version
14:04:52FromGitter<Yardanico> `br` encoding
14:05:45FromGitter<Yardanico> and clojure compiler made JS code size of snake (without compression) 2x smaller
14:07:03*couven92 quit (Remote host closed the connection)
14:07:16FromGitter<codem4ster> hmm sounds good. What about external libraries? Can I use them in my Nim code?
14:07:23*couven92 joined #nim
14:07:27FromGitter<Yardanico> of course, you can interface with any JS libraries
14:08:52FromGitter<codem4ster> ok I will try and see how it looks like.
14:09:57FromGitter<codem4ster> with these capabilities Nim really deserves a great isomorphic web framework.
14:10:30*ng0 joined #nim
14:11:06*couven92 quit (Remote host closed the connection)
14:11:29*couven92 joined #nim
14:13:41FromGitter<tim-st> @Araq should it be unreachable code bug if all cases are checked and an `else` is there?
14:13:54FromGitter<tim-st> *error not bug
14:14:49FromGitter<tim-st> (all cases of a case)
14:15:08*couven92 quit (Remote host closed the connection)
14:15:30*couven92 joined #nim
14:17:45FromGitter<Araq> currently the spec says something like "an else prevents the exhaustiveness check"
14:18:18FromGitter<Araq> and so it's accepted and doesn't count as unreachable code
14:18:43FromGitter<tim-st> ah, ok, thanks
14:19:20*couven92 quit (Remote host closed the connection)
14:19:40*couven92 joined #nim
14:21:12FromGitter<gemath> Is there a way to start the Travis CI build for Nim manually (without committing)?
14:21:55FromGitter<codem4ster> @Yardanico in your thread example VS Code doesn't recognize Thread type and createThread proc (when writing code). Is there a way that tell to the extension about threads. :)
14:22:27FromGitter<Yardanico> @codem4ster yes. create `nim.cfg` in the same folder as your nim file (or `filename.nim.cfg`), and write `threads:on` in this file
14:23:21*couven92 quit (Remote host closed the connection)
14:23:45*couven92 joined #nim
14:24:14FromGitter<Yardanico> @codem4ster or (modern way) - create `filename.nims` and write `switch("threads")`
14:24:30FromGitter<Yardanico> sorry, `switch("threads", "on")`
14:26:39*brainproxy quit (Quit: WeeChat 2.1)
14:27:22*couven92 quit (Remote host closed the connection)
14:27:42*couven92 joined #nim
14:27:51FromGitter<Varriount> Araq: One thing I think I might be confused on - does the proposed exception system allow Library writers to define their own error values?
14:28:04*enthus1ast quit (Ping timeout: 244 seconds)
14:28:29FromGitter<codem4ster> thanks @Yardanico is this documented anywhere?
14:28:36FromGitter<Yardanico> yes it is
14:28:50FromGitter<Yardanico> https://nim-lang.org/docs/threads.html `--threads:on`
14:29:07FromGitter<Yardanico> and https://nim-lang.org/docs/nimscript.html for `.nims` files
14:29:36*couven92 quit (Client Quit)
14:29:54*couven92 joined #nim
14:30:37stefanos82what happens when you have more than one module that depends on --threads:on? wouldn't be more convenient if you placed the thread flag inside your local nim.cfg?
14:31:40Yardanicostefanos82, you have one main file in your program
14:31:58stefanos82fair enough
14:33:58*donlzx joined #nim
14:41:58FromGitter<codem4ster> Is there any plan or thoughts to add sub-modules to the language?
14:42:06Yardanicowhat do you mean by that?
14:43:46*brainproxy joined #nim
14:45:20FromGitter<codem4ster> may be myVeryOwnFramework::Routes
14:45:43FromGitter<codem4ster> routes in here is a submodule
14:46:00FromGitter<Yardanico> you can of course do that
14:46:08FromGitter<codem4ster> how?
14:47:02subsetparkcodem4ster: do you just mean putting files into directorys? you can have hierarchical namespaces
14:48:25FromGitter<codem4ster> ok I got it
14:49:05FromGitter<codem4ster> it only doesn't work when the sub-module name is same with another
14:49:09FromGitter<codem4ster> it must be unique
14:49:55stefanos82Araq: is it possible to overload backticks?
14:49:56*couven92 quit (Remote host closed the connection)
14:50:21FromGitter<codem4ster> but this leads into that its not a sub-module also :(
14:50:31Yardanico@codem4ster why?
14:50:37FromGitter<codem4ster> every sub-module also a module
14:50:50FromGitter<Yardanico> yes, and why that's bad?
14:51:07*couven92 joined #nim
14:51:19FromGitter<codem4ster> because a::b is different from c::b
14:52:08FromGitter<codem4ster> also a:🅱️:c is different from c
14:52:57FromGitter<Yardanico> if you have a module in myframework/utils/module.nim you can't import it by "import module"
14:53:40FromGitter<codem4ster> I know and I must be
14:54:42FromGitter<codem4ster> but ./myframework/utils/module.nim and ./module.nim cannot be declared at the same time, right?
14:54:48Yardanicoyes they cannot be
14:55:16stefanos82Yardanico: what if you add --path in module.nims and point at the right direction to make it work, assuming you are going to alias it by giving it a unique name so you can avoid possible name conflicts
14:56:24PMunchDoing some more work on options, I think they're getting pretty nice. Currently can be seen in my cooloptions branch in my fork, but it's not done yet so no PR.
14:56:33PMunchStruggling with implementing != for options..
14:57:18FromGitter<codem4ster> may be because of I'm coming from Ruby it doesn't feel right considering a/b and b are same modules and cannot be declared at the same time. :(
14:57:18PMunchNim seems to insist that != is converted to not ==
14:57:45*PMunch quit (Quit: Leaving)
14:59:27FromGitter<codem4ster> there is a `bad parts` section in this blog post. I'm agreed with this guy https://hackernoon.com/read-world-nim-adventures-5dc85ac7d9d6
15:00:31Yardanico@codem4ster well, he was new to nim, that's why he promotes things like "from x import a, b, c"
15:01:22Yardanico"import failure" did he make a bug report?
15:05:32Yardanicoand his app doesn't look like best nim practices :)
15:05:46FromGitter<Araq> I will change that but I keep wondering if you ever talk about your code with anybody. do you then say "b slash a" all the time in order to give precise instructions.
15:06:07FromGitter<Araq> because you know, "module a" is then totally ambiguous.
15:09:17FromGitter<Quelklef> i just read "framework/utils/module" as "framework utils module"
15:09:34FromGitter<Quelklef> not too painful
15:16:00*miran joined #nim
15:19:19*Trustable joined #nim
15:20:40*couven92 quit (Ping timeout: 245 seconds)
15:31:00*jjido joined #nim
15:38:02*couven92 joined #nim
15:38:10FromGitter<tim-st> is it expected that `echo getOccupiedMem()` works and `echo getOccupiedMem` doesnt?
15:39:08FromGitter<tim-st> `echo "".len` and `echo "".len()` works both
15:39:32dom96yes, you're trying to echo a proc type
15:40:04*couven92 quit (Remote host closed the connection)
15:40:20FromGitter<tim-st> ok, I thought getting proc type like in python doesnt work in nim, because strictly when I call `echo "".len` I call a proc type too
15:40:41Yardanicono, with "".len you do len("")
15:41:33*couven92 joined #nim
15:42:04FromGitter<tim-st> hm, ok, not 100% expected, thought this a few times before
15:53:17FromGitter<Quelklef> yeah what exactly is the disambiguation process for this?
15:57:53FromGitter<Quelklef> Ok, here's what I've found out:
15:58:00FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50b507ad8d085553b0ba5e]
15:58:41miranbecause `2.C` is the same as `C(2)`
15:59:50FromGitter<Quelklef> right
16:00:55FromGitter<Quelklef> I thought the ability to omit `()`s in proc calls was more flexible than it actually is
16:02:04miranto be honest, even where i could omit it, i usually keep it to better differentiate some `x.field` from `x.function()`
16:02:58FromGitter<Quelklef> Yeah
16:03:13FromGitter<Quelklef> I think usually I omit if it's conceptually a property, and keep 'em if it's an action
16:07:47*donlzx quit (Quit: Leaving)
16:08:10*couven92 quit (Read error: Connection reset by peer)
16:15:32*nsf quit (Quit: WeeChat 2.1)
16:28:32*couven92 joined #nim
16:30:04FromGitter<Araq> I leave them out more and more. every line is a function call.
16:33:49*couven92 quit (Quit: Client disconnecting)
16:36:54FromGitter<Quelklef> "every line is a function call
16:36:59FromGitter<Quelklef> " come again?
16:38:53*yglukhov[i] quit (Remote host closed the connection)
16:41:30FromGitter<tim-st> @Quelklef thanks for your example, so it was correct that it only works sometimes
16:42:04*krux02 joined #nim
16:42:56*jjido quit (Read error: Connection reset by peer)
16:45:40*chopzwei quit (Remote host closed the connection)
16:46:27*krux02 quit (Ping timeout: 240 seconds)
16:46:59FromGitter<Araq> no, not "sometimes", it's clearly written down in the manual
16:47:09*krux02 joined #nim
16:47:28FromGitter<Araq> foo() aka "nullary function calls" are the only calls where the () cannot be avoided
16:49:52FromGitter<tim-st> In the following case only a function call is possible:
16:49:56FromGitter<tim-st> proc test() = echo "test" ⏎ test
16:50:21FromGitter<tim-st> so when it's flexible for all other ways, I'd expect it for this case too
16:51:15FromGitter<tim-st> for all other cases I'd expect the compiler to findout by looking whether the type fits
16:51:30FromGitter<Quelklef> Noooooo, it should not depend on the typing
16:51:32FromGitter<Araq> proc test() = echo "test" ⏎ proc x(): proc() = test # kaboom.
16:51:35FromGitter<tim-st> if 2 or more are fitting the error message is expected, else not imo
16:51:47FromGitter<Quelklef> That'd mean devs can't tell if it's a reference or a call without knowing the type of the function, which is super icky
16:52:06*Trustable quit (Remote host closed the connection)
16:54:11FromGitter<Quelklef> Also, it'd mean that adding a proc can cause errors in an unrelated portion of code
16:54:11krux02scala solves this the other way around. When the function has 0 arguments and you want to pass it as a function, then you have to put an `_` behind the function name.
16:54:12FromGitter<Quelklef> consider;
16:54:15*dorelix joined #nim
16:54:47FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c257cad358639d672079]
16:54:56FromGitter<Quelklef> @krux02 Ruby does something similar, right?
16:55:06krux02I don't know ruby at all
16:55:07FromGitter<Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c26b623cc3040b30bb44]
16:55:26FromGitter<Quelklef> Ah
16:55:55FromGitter<tim-st> @Quelklef As I said above: "if 2 or more are fitting the error message is expected, else not imo"
16:56:29FromGitter<Quelklef> Right, my point is that adding a new proc caused an error when there was none before
16:56:42*jjido joined #nim
16:56:49FromGitter<Quelklef> I suppose some similar things exist already (e.g. namespace conflicts), but...
16:57:59FromGitter<tim-st> yes, but imo the error is good here, because the code you have shown is in fact very bad
16:58:25FromGitter<tim-st> well, atleast for this example^^
16:58:30FromGitter<Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c336ad8d085553b0eb9e]
16:58:40FromGitter<Quelklef> I'm not disagreeing that there should be an error...
16:59:00FromGitter<Quelklef> That example's even better
16:59:15FromGitter<krux02> pure functional languages alse are able to make a value and a function with 0 argumenst syntactically identical
16:59:32FromGitter<krux02> because it doesn't matter semantically, a function may not have side effects
16:59:36FromGitter<tim-st> what's wrong with the example? I think local name as higher prio
16:59:38FromGitter<Araq> I think that's only true for 'lazy' languages
16:59:44FromGitter<krux02> but Nim isn't pure functional
16:59:58FromGitter<krux02> no it is not
17:00:19FromGitter<krux02> a function doesn't need to be lazy for that, but it needs to be purly functional.
17:00:29FromGitter<tim-st> i dont want to say that I call function like `test` I prefer brackets
17:00:32FromGitter<Araq> not a function, the language.
17:00:43FromGitter<krux02> a fucniton can evaluate a functiosn with 0 arguments instantly any replace it by it's result for the rest of the program
17:00:45*chopzwei joined #nim
17:00:51FromGitter<tim-st> but I coped the proc from Araq's packedjson without brackets and was suprised
17:00:56FromGitter<tim-st> *copied
17:01:11*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:03:07FromGitter<Araq> @krux02: the type is () -> T vs T, I don't see how you can do away with this difference in a purely functional language. are you saying it's an implicit type conversion?
17:04:16FromGitter<Araq> cause these types are definitely not the same, side-effects or not.
17:04:17FromGitter<Quelklef> Typically `() -> T` can't exist in PF language
17:04:54FromGitter<Araq> ah ok. that might work.
17:06:38FromGitter<codem4ster> > ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ in Ruby you can not assign function definitions to a variable. So you can not use them as parameters like this. [https://gitter.im/nim-lang/Nim?at=5b50c51e03a5fa639e68423f]
17:07:07FromGitter<Quelklef> Uck, really?
17:07:40FromGitter<Araq> doesn't this require an `&` in Ruby. never learned the language though.
17:08:02FromGitter<mratsim> the only pure functional language i know of are Haskell and Idris though @krux02
17:08:10FromGitter<Quelklef> IIRC, the `&` is in the recieve proc definition. It requires something tho
17:08:18FromGitter<Quelklef> @mratsim Curry too
17:08:38FromGitter<codem4ster> ```def a_fun ⏎ # do smt ⏎ end ⏎ ⏎ a = method(:a_fun)``` ⏎ ⏎ this is the only way [https://gitter.im/nim-lang/Nim?at=5b50c5953187ca3ee8c28438]
17:08:39FromGitter<mratsim> does Ocaml make 0 arg function and value syntactically identical for example?
17:09:37FromGitter<mratsim> @Quelklef never heard of curry.
17:10:18FromGitter<Quelklef> It's really cool, though perhaps not actually useful. It's a superset of Haskell. Check this out: https://jeltsch.wordpress.com/2013/04/27/a-taste-of-curry/
17:10:28FromGitter<krux02> @Araq I don't know about every functional language, but in Haskell there is lazy evaluation, meaning let x = 123 + 456 is not evaluated unless x is actually used in the result. This holds also for function arguments. So things where nim needs a template for parameters to prevent argument evaluation, haskell can just do with functions
17:11:44FromGitter<krux02> and in f# there are aparently problems: https://stackoverflow.com/questions/2797662/f-function-with-no-arguments
17:12:17FromGitter<tim-st> btw is a codeblock in gitter created using the same why like on github?
17:12:24*stefanos82 quit (Quit: Quitting for now...)
17:12:37FromGitter<Quelklef> Yes, they're both markdown-based
17:12:43*nsf joined #nim
17:12:50FromGitter<tim-st> ```nim echo "test"```
17:12:55FromGitter<tim-st> doesnt work
17:13:08FromGitter<tim-st> ```echo "test"```
17:13:15FromGitter<Quelklef> three backticks, "nim", newline, code, newline, three backticks
17:13:42FromGitter<krux02> ```` ```nim ````
17:13:45FromGitter<tim-st> ```echo "test"```
17:13:48FromGitter<Quelklef> tada
17:13:59FromGitter<tim-st> yes, thanks, but I cannot do it from the input directly
17:14:04FromGitter<tim-st> have to copy paste
17:14:10FromGitter<Quelklef> ...huh
17:14:15FromGitter<tim-st> or?
17:14:24FromGitter<codem4ster> I think paranthesis must be mandatory although I'm coming from a Ruby world.
17:14:31FromGitter<krux02> I usually write it in an editor anyway, so it's not that much of a problem
17:14:49FromGitter<tim-st> ok, it works, good to know, thanks
17:14:54FromGitter<rayman22201> @tim-st shift enter
17:15:08FromGitter<tim-st> yes, I now saw a template is created in the input field
17:19:30FromGitter<codem4ster> > doesn't this require an `&` in Ruby. never learned the language though. ⏎ you must use that type of definition immediately you cannot pass to another scope or code. ⏎ ⏎ ```[1, 2, 3].map(&:sum)``` [https://gitter.im/nim-lang/Nim?at=5b50c822ecc1f82e2fc6ba4a]
17:22:03FromGitter<codem4ster> and you cannot define a method inside this map function call, you must define inc before
17:22:26FromGitter<Quelklef> Can't you do like `[1, 2, 3].map {|i| i + 1}`?
17:22:51FromGitter<codem4ster> yes you can but this is not defining a method
17:23:51FromGitter<codem4ster> and you cannot move `{ ... }` anywhere
17:23:57*yglukhov[i] joined #nim
17:24:48FromGitter<codem4ster> this is a proc and procs are a bit different than methods
17:24:50*jjido quit (Ping timeout: 276 seconds)
17:25:10FromGitter<codem4ster> because of their scope
17:25:30FromGitter<rayman22201> Why do you want to do that? Nim is not an OOP language like Ruby
17:26:05krux02Yes nim is superior to OOP
17:26:06krux02:P
17:26:15FromGitter<Quelklef> ^
17:27:14FromGitter<rayman22201> Lol
17:28:34FromGitter<Quelklef> I tried to understand ruby's approach to functional programming once
17:28:37FromGitter<Quelklef> I don't plan on going back, lol
17:31:24FromGitter<codem4ster> I firstly tried so much times to use passing procs and yielding on another method but it only increase complexity in Ruby
17:32:25FromGitter<codem4ster> Ruby has nearly perfect OOP techniques but not good at functional programming I think
17:32:45FromGitter<Quelklef> grrr, like Python
17:33:16FromGitter<Quelklef> I like Python but damn if it isn't one of the more painful languages to do functional things in
17:33:38FromGitter<Quelklef> even Java's got it beat! `ar.map(e -> e+1)` in Java vs `list(map(lambda x: x + 1, ar))` in Py
17:34:01FromGitter<Quelklef> Wait, actually I think I'm misremembering
17:34:25krux02Quelklef: I think java got a lot of it's features from scala.
17:34:30*yglukhov[i] quit ()
17:34:37FromGitter<Quelklef> Java might be `ar.stream().map(e -> e + 1).collect(Collectors.toList())`
17:35:12FromGitter<Quelklef> Scala is good OOP/FP, right? I never learned it :\
17:35:32FromGitter<codem4ster> but Ruby has simply perfect module and include system I have ever seen
17:35:41krux02Martin Odersky, the initiator of Scala also made the Generics for Java and showed how it would work. Then Java just took them over. A lot of other features are now taken over from Scala.
17:35:50krux02One of them is I think the lambda syntax.
17:36:06FromGitter<Quelklef> Oh wow
17:36:50FromGitter<Quelklef> Is that where JS' lambda syntax comes from too?
17:36:51krux02so your example worked like that in Scala in 2010 when I learned it.
17:37:10*yglukhov[i] joined #nim
17:37:14krux02don't ask me about JS, I avoid that language
17:37:23krux02too many people have an opinion abuot that.
17:37:31*UxerUospr joined #nim
17:37:33FromGitter<Quelklef> hahahah
17:38:11FromGitter<mratsim> Too many languages to avoid, Java, JS, PHP … I just can’t get out they are everywhere
17:38:28FromGitter<Araq> FP suits Java though, another hyped, failing paradigm that produces overhead everywhere and is very hand-wavy about its specifics ("yeah, recursion is just better to reason about!" -- "Is that a tail recursion or not?" -- "oh shut up already.")
17:38:31krux02some people think it is amazing, some people think it is horrible. And thores don't know it. And the third category is the only category that doesn.t exist and that I would like to be the biggest.
17:39:28krux02Araq: from my experience with scala I can tell you that is not true
17:39:32krux02yes it is a lot of overhead
17:39:38krux02but it changed my way of thinking about loops
17:39:55krux02it gave a lot of operations that I did in a loop a clear name
17:40:05FromGitter<codem4ster> I look some static typed compiled languages and saw that if you want to use a lib you must import it on every file you need to use ⏎ is this mandatory? if A uses B and B uses C why I need to import C in A again ( I already imported C in B and B in A)
17:40:22krux02I still think about map fold reduce and all that stuff when I write my loops,
17:40:47krux02I just don't write ``map`` and that stuff down anymore, because I like to prevent the overhead
17:42:30krux02What I experience in Scala was, then when you wanted your program to be correct, and the compiler told you, "everything OK I can compile" then it was correct.
17:42:52FromGitter<Quelklef> hmmmmmm
17:43:10FromGitter<Quelklef> That's not even 100% true in Haskell, so I have trouble believing you
17:43:18krux02I never had null pointer exceptions or other unexpecting behaviour
17:43:40krux02I don't want to say that you can't break it
17:44:21krux02you can cause NullPointerException and that stuff, but the language really encourages you to write in a style that doesn't do that
17:44:41FromGitter<Quelklef> right
17:44:45FromGitter<Quelklef> your claim was just a bit strong
17:45:31krux02The reason I stopped using scala was that is has too much overhead for it's data types
17:45:55krux02(generally true for all "true" OOP languages)
17:46:07krux02too long compilation times
17:46:11krux02(also true for c++)
17:46:19FromGitter<Quelklef> You're not a fan of AbstractProxyFactoryHandlers?
17:46:43FromGitter<rayman22201> https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html?m=1
17:46:54FromGitter<rayman22201> :-P
17:46:57krux02and no flat memory data structures. Only ByteBuffer
17:47:17krux02Quelklef: the scala land doesn't do that
17:47:36FromGitter<Quelklef> gaw bless
17:47:54krux02but since scala can just use everything that has been written in Java, you are not entirely safe from it.
17:48:04krux02depends on what libraries you use.
18:01:02*yglukhov[i] quit (Remote host closed the connection)
18:02:36FromGitter<mratsim> @codem4ster to avoid polluting namespace
18:09:45krux02@codem4ster: nim has an export statement for that. Often the situation you mentioned is the following. C is some ugly library. B is a nice facade that just exposes what you need from it in a nice way and in A you don't want all the pollution from the ugly library C.
18:10:01*Perkol joined #nim
18:10:30krux02but sometimes C are datatypes that are part of the interface to B, then you export C in B and then when you import B you can also use C.
18:10:57UxerUosprI made a dumb mistake and fixed it but I'm wondering why the compiler error is so unhelpful here: https://gist.github.com/optik-aper/97f8fab8c15d3153738ffd94ed8b284d
18:11:34UxerUosprParticularly: required type: Stream
18:11:37UxerUospr but expression 's' is of type: Stream
18:12:05UxerUosprI realize now that it was complaining that I didn't have a TaintedString
18:12:54PerkolHi. I want to ignore exceptions from myfunc() am I doing it right? https://bpaste.net/show/646da83bcde4
18:13:53krux02UxerUospr, I don't know why you think the error message was unhelpful
18:14:30UxerUospr"Require type: Stream but expression ... is of type: Stream"
18:14:30krux02no wait
18:14:32krux02that is a bug
18:14:43krux02yes that is a bug
18:14:50krux02you should report it is the issue tracker
18:14:57krux02it should complain about the second parameter
18:15:01UxerUosprOkay, thanks for looking!
18:15:20FromGitter<Quelklef> @Perkol yes, I think so, but you shouldn't be ignoring all exceptions
18:16:01krux02@Perkol there is a difference between ignoring exceptions and discarding excepitons
18:16:43krux02what you are doing is discarding all exceptions. That is always a bad thing to do.
18:17:24krux02it prevents you from finding the source of a problem if an excepiton actually comes up
18:17:38FromGitter<Quelklef> Why, @krux02, whatever do you mean? The more `try {} catch {}` I add, the less errors my code will throw...
18:18:15krux02no
18:18:31krux02it will still throw the same amount of error, you catch them and discard them
18:18:42FromGitter<Quelklef> exactly. the more catch, the less crash
18:18:46krux02basically throwing away information in the trash
18:18:47FromGitter<Quelklef> it rhymes so it must be wise
18:19:16krux02if you write a catch, then you should deal with the error
18:19:43krux02if you don't deal with the error, a crash is actually more wise than a crash later that is impossible to find the real source of.
18:19:55FromGitter<Quelklef> I'm not serious mate
18:20:04krux02I was worried
18:20:16FromGitter<Quelklef> lol
18:22:02krux02there is a lot of information lost on chat conversation, so it is not always easy to get irony. But yea I should have known better in this case.
18:25:10*cspar joined #nim
18:28:43UxerUosprIssue submitted: https://github.com/nim-lang/Nim/issues/8368
18:36:20krux02UxerUospr, you should mention what is acutally the problem in the error message
18:36:35krux02and how the error message should be
18:36:46krux02not how to fix your program.
18:43:24krux02UxerUospr, when I test on current version of Nim, the error message is slightly better, but still wrong.
18:46:58UxerUosprI thought about building the devel version to test it there but that involves a bunch of symlinks in my setup so I was lazy. I'm glad it's still broken and I'm not wasting everyone's time
18:47:22UxerUosprI edited the issue to accomplish what you suggested
18:47:36UxerUosprkrux02: thanks for the feedback
18:50:09*endragor joined #nim
18:54:34krux02UxerUospr, i symlink nim always to ~/bin
18:54:38krux02and put that in path
18:55:11*endragor quit (Ping timeout: 276 seconds)
18:55:41UxerUosprkrux02: I do the same, but I also do nimble, nimgrep & nimsuggest
18:55:59UxerUosprand you have to remove the old symlinks first or will complain
18:56:29UxerUosprkrux02: Easy enough, I know, I'm just very lazy
18:56:46miranchoosenim to the rescue?
18:58:31UxerUosprmiran: I should look into it :)
18:58:58miranit is quite easy and fool-proof (as confirmed by me)
19:08:23*Perkol quit (Quit: Leaving)
19:41:17FromGitter<tim-st> I saw the `packedjson` still uses like 100mb ram for ~100mb mem file, wouldnt it be possible to build a parser that reads from stream only the things that are currently interesting?
19:41:24FromGitter<tim-st> like iterator only
19:44:45FromGitter<tim-st> I expect such a parser to use 200kb ram at max
19:45:19FromGitter<tim-st> (besides big strings of course)
19:47:57FromDiscord<exelotl> finally at the macros chapter oh boy
19:50:01*floppydh quit (Read error: Connection reset by peer)
19:50:54*floppydh joined #nim
19:58:04FromGitter<Varriount> @tim-st Not when the view that is exposed to the user is a tree view.
19:58:20FromGitter<tim-st> but which users want that?
19:58:30FromGitter<tim-st> I never had such a use case with json
19:58:37FromGitter<tim-st> I always iterate over it
19:58:42FromGitter<Varriount> Most people? The alternative is event based
19:59:02FromGitter<Varriount> JSON has both dictionary and list structures.
19:59:07FromGitter<tim-st> Do I need to read 100mb in a ram if I only want the len of current JsonNode?
19:59:10krux02tim-st not really
19:59:34krux02I think the best way to use packedjson is with memory mapped files
19:59:53dom96huh, what's the point of packedjson if this is the case?
19:59:55FromGitter<tim-st> krux02: I'm currently building my own, I dont see why it shouldnt work
20:00:10*NimBot joined #nim
20:00:25FromGitter<tim-st> but isnt this memory somehow reserved?
20:00:33krux02well it does work with a stream api, but then you are very limited in processing that json also like a stream
20:00:40krux02so you will never be able to go back
20:00:44*Jesin joined #nim
20:00:46FromGitter<tim-st> yes, that's good
20:00:50FromGitter<tim-st> I can
20:01:01FromGitter<tim-st> at least I can save the last important start
20:01:10krux02well when you can always go back then you need to store that somehow
20:01:11FromGitter<tim-st> It's a bit worse than seq but still ok
20:01:52krux02tim-st: whatever you do, whatever you optimize you will always make it worse somewhere else
20:01:56FromGitter<tim-st> yes, as I wrote above. But for my use cases I only wanted one direction. And if I really want to go in both direction I use iter.toSeq
20:02:03krux02there is no perfect solution for every use case
20:02:23FromGitter<tim-st> yes, what's the recommended way to declare iterator[T] ? concept?
20:02:30krux02memory mapped files allow you to jump arbitrary and don't consume the memory physically
20:02:49FromGitter<tim-st> but what's the downside of them?
20:02:51krux02but memory mapped files might be a bad idea when the virtual memory space is small
20:02:54FromGitter<tim-st> I saw lmdb uses this too
20:03:16krux02yes, and I think memory mapped files is the way to go when you use 64 bit CPU
20:03:51krux02on 32 bit applications you would not be able to open files bigger than 4 gb, and then there would be no memory left for your actual program
20:04:00FromGitter<tim-st> but I dont really see a pro point compared to parsing stream on the fly
20:04:09FromGitter<tim-st> because I have indices on the fly
20:04:28FromGitter<Varriount> Parsing a data structure on the fly is tedious.
20:04:31krux02well I don't know the details, but as far as I know, memory mapped files are the fastest way to access a file.
20:04:51krux02but it doesn't work with pipes in the file system
20:05:12FromGitter<tim-st> I think that's only true if you know for sure how you can access your data
20:05:21FromGitter<tim-st> but for json you have to parse first
20:05:35krux02memory mapped files use the mmu unit to buffer parts of the file.
20:05:41*riidom_ quit (Ping timeout: 255 seconds)
20:05:42FromGitter<Varriount> @tim-st https://github.com/OpenSystemsLab/jsmn.nim
20:05:49krux02and the mmu (memory management unit) is something that has to run anyway
20:06:02krux02and with streams you have an additional indirection with the buffer
20:06:34FromGitter<tim-st> @Varriount thank will test this now
20:06:37FromGitter<tim-st> *thanks
20:06:38krux02json you don't need to parse first. You can parse lazy.
20:06:53FromGitter<tim-st> That's what I meant of course
20:07:31FromGitter<tim-st> I dont see a human usable api for this lib
20:07:40krux02and you can go back and forth in memory
20:07:44krux02streams can only go forward
20:08:29FromGitter<Varriount> @tim-st As I said, event based parsers have usability issues.
20:09:17FromGitter<tim-st> When I see that this one works very good, I just wrap it for humans
20:09:38FromGitter<tim-st> very good regarding speed and mem
20:11:23FromGitter<rayman22201> @Varriount poke. We are awake at the same time! lol
20:11:58FromGitter<tim-st> @Varriount maybe I'm missing something, but the lib you linked loads the full string in memory
20:12:11FromGitter<tim-st> If my file has size 8gb this will break my system
20:12:18FromGitter<tim-st> I cannot use this lib
20:12:52FromGitter<tim-st> ah, you wrote this here: https://github.com/OpenSystemsLab/jsmn.nim/issues/2
20:13:52FromGitter<tim-st> So, I need to write my own, like I did for the UCA algorithm and already my first version was the quickest ever built :D
20:15:25FromGitter<rayman22201> memory mapping won't break your system... Though you might see a lot of page swapping, becasue mmap does caching inside the kernal
20:15:58FromGitter<tim-st> ok, but the lib linked doesnt use memory mapping
20:16:11FromGitter<rayman22201> mmap will "Map" your file to an address space, but it doesn't actually load all that into memory at once.
20:16:46FromGitter<tim-st> ok, sounds interesting at least, I'll read what others did with json and memory mapping
20:18:31FromGitter<rayman22201> ah. I see. Yeah, the lib doesn't use mmap. Wouldn't be too hard to mod that library to use mmap though... I think...
20:20:37FromGitter<tim-st> Yes, thought so, too. But already my first try showed that it doesnt understand integers datatype, my lib should support all types
20:20:58FromGitter<tim-st> it parses it correctly but doesnt know what it is
20:21:05FromGitter<Araq> feel free to use parsejson.nim (new in devel)
20:21:39FromGitter<Araq> that only gives you the parser, it streams, you can then extract the length or whatever by token counting
20:22:08FromGitter<tim-st> ah, nice, I really searched for this via google, 0 matches
20:22:29FromGitter<tim-st> really was confused where you get this import from because I deactivated nimsuggest :\
20:25:10FromGitter<tim-st> yes, that looks really helpful, thanks!
20:29:12*PMunch joined #nim
20:29:38*Vladar quit (Quit: Leaving)
20:30:03FromGitter<Araq> about `mmap`, I'm skeptical. needs a decent benchmark to convince me. And even then I can think of more useful things to fill my RAM with.
20:31:02FromGitter<rayman22201> mmap doesn't actually fill your ram though
20:32:42FromGitter<tim-st> yes, I'm also sceptical, but at least my lmdb tests show that's extremely fast. RocksDB and others have no chance even with all cores on
20:32:45*nsf quit (Quit: WeeChat 2.1)
20:32:56FromGitter<tim-st> (compared to lmdb which uses this)
20:34:06FromGitter<Araq> https://eklausmeier.wordpress.com/2016/02/03/performance-comparison-mmap-versus-read-versus-fread/
20:34:24FromGitter<Araq> "With the file on SSD the result is even more fading away to the file stored on hard-disk: running times between read() and mmap() are almost identical, contrary to the result on kernel 4.3.3."
20:34:59FromGitter<tim-st> lol
20:35:17FromGitter<tim-st> but seems that it got very good marketing
20:36:37FromGitter<Araq> ripgrep doesn't use mmap. the author tried and it was slower.
20:36:47FromGitter<Araq> (at the end of my linked article)
20:36:50FromGitter<rayman22201> same article: ⏎ "With all that said, memory maps aren’t all bad. They just happen to be bad for the particular use case of “rapidly open, scan and close memory maps for thousands of small files.” For a different use case, like, say, “open this large file and search it once,” memory maps turn out to be a boon. We’ll see that in action in our single-file benchmarks later. "
20:36:56FromGitter<rayman22201> depends on the use case
20:37:00FromGitter<Araq> yup.
20:40:28FromGitter<rayman22201> mmap is very good for databases, but that is a very different use case to parsing / grepping
20:45:32krux02PMunch, are you there?
20:45:39PMunchYup
20:45:50krux02I wrote an alternative to your optOr macro
20:45:54krux02have you seen it?
20:46:04PMunchUhm no, but I've since rewritten the entire thing
20:46:08PMunchWith lot's of neat stuff
20:46:27krux02https://github.com/nim-lang/Nim/pull/8369
20:46:28PMunch.?, a pattern matcher, and combinatorial operators
20:46:37PMunchCommenting up everything now :)
20:47:10krux02I have test cases :P
20:47:16PMunchMe to :)
20:47:40PMunchJust to give you a sneak peek: http://ix.io/1hLT
20:48:39FromGitter<Quelklef> @krux02 what's the purpose of `let xx = x`?
20:48:40krux02https://github.com/krux02/Nim/blob/5e07428abb7024ca9eada3c5ae054e2157ebd312/lib/pure/options.nim#L344
20:48:48FromGitter<Quelklef> Oh, nevermind
20:48:50FromGitter<Quelklef> for side effects
20:49:11PMunchYeah
20:52:17krux02PMunch in your check "Is hundred"
20:52:29krux02normally pattern matching goes from to to bottom picking the first match
20:52:41krux02that is how it is done in Haskell and how it is done in Scala
20:52:44PMunchWell this wraps everything in a case
20:53:02krux02so some x: would already match the 100
20:53:07krux02to my intuituon
20:53:10*miran quit (Ping timeout: 245 seconds)
20:53:18krux02that is also how ``ast-pattern-matching`` works
20:53:50PMunchBasically the matcher get's turned into an if x.isSome: case x.value: <bodies> else: <body without arguments>; else: none()
20:54:24PMunchWell I decided it would be better to just convert it to a case, that way anything you can do in a case statement you can do with this
20:54:30PMunchWith zero code-duplication
20:55:13PMunchIt would probably be more natural to your regular Nim programmer
20:56:37krux02I also don't really like the ``some _ of 100`` notation.
20:56:49krux02I would prefer if you could leave out the pattern matching
20:57:04krux02for the operators, you seem to be pretty similar to what I have written
20:57:50krux02pattern matching for nim is still something unsolved and that needs careful design, you can't just start with something and then extend it when you think you need to do it.
20:59:04PMunchWell, this is just a convenient wrapper around an if check and a case statement
20:59:20PMunchAll the actual matching is done in the case statement
20:59:37krux02still, it would consume that name "match" for the option type
21:00:02PMunchWell, as always I'm cool with changing the name
21:01:03krux02I would really prefer if you could split that PR into the logical operators, and the pattern matching.
21:01:37krux02I would like to use the word `match` for the general pattern matching.
21:01:54FromGitter<Araq> oh and one more thing, `mmap` doesn't support async IO.
21:02:50krux02Araq: that conversation is quite some time ago? Or is there a bridge broken on IRC?
21:03:09krux02but yes mmap doesn't supprot async IO, that might be a problem.
21:03:22*vegax87 quit (Changing host)
21:03:22*vegax87 joined #nim
21:03:22*vegax87 quit (Changing host)
21:03:22*vegax87 joined #nim
21:03:23krux02when there is a chache miss the thread is blocked.
21:04:02krux02but I would recommend to put everything that works on a bottleneck on a separate thread anyway
21:04:28krux02noe thread processes the blocking IO and when it is done it signals this to the main thread somehow
21:04:41krux02then it is async
21:06:29*yglukhov[i] joined #nim
21:07:45krux02PMunch: can you do this: check((genNone() and 1 or 2) == 2) where genNone() returns an option[string]?
21:09:11PMunchAh no, I forgot to have them accept different types
21:09:48krux02and ``genNone() or "mystring"``
21:10:05*UxerUospr quit (Quit: Lost terminal)
21:10:55FromGitter<tim-st> are default values for objects planned?
21:11:25FromGitter<tim-st> I mean like `a=1` instead of `a: int`
21:11:36krux02tim-st: the default value is zero initialized memory
21:11:44FromGitter<tim-st> yes
21:11:51PMunchkrux02, yeah both of those now work
21:11:58krux02cool
21:12:00PMunchAssuming genNone returns a none :)
21:12:05krux02can you take over my test cases pleas?
21:12:09krux02yes
21:12:49krux02or at least use my test cases and try if they work with your implementation
21:13:11krux02I hope you implemented `or` and `and` with templates and not with macros
21:14:18krux02tim-st: you can change the semantics of zero memory in your classes, but I don't know about any plans to introduce default initialized members
21:14:38FromGitter<tim-st> ok, thanks
21:15:11krux02it is also a nice property to know that "var myvar: MyType" is always a black object with no information in it.
21:15:17FromGitter<tim-st> btw today I had this problem again when I want to set param of a proc =-1 that's parsed as decrement :\
21:16:03FromGitter<tim-st> yes, but sometimes it's quite useful, I now have a case where I want it to be `a = -1`
21:16:54krux02well you can make that case 1 indexed so that a 0 means nothing
21:17:30FromGitter<tim-st> I dont know what you mean, it's an int
21:17:41krux02what does that int mean?
21:17:48krux02what does it count?
21:18:01FromGitter<tim-st> -1 == the length of the number is not yet found out
21:18:35krux02what about option[int]?
21:18:44krux02that one is default initialized to none
21:19:03FromGitter<tim-st> I hate this option[T] things I dont "feel" what this is, so I dont use it
21:19:07krux02but it uses twice the memory of an int
21:19:26FromGitter<tim-st> hah, that's the downside I really that it has
21:19:28krux02well it is not yet fully developed.
21:19:31FromGitter<tim-st> *thought
21:19:36krux02so I get when you don't want to use it
21:19:42krux02I feel similar
21:20:06krux02but the idea of an option type is that you stop abusing special values as "I actually don't have a value"
21:20:14FromGitter<tim-st> I prefer nim to have a clean syntax, I know that rust uses it too, and people really party this type there
21:20:41krux02I also want a clean syntax
21:20:49krux02and option is not yet clean
21:21:03FromGitter<Quelklef> krux02, what do you think of `T?` rather than `Option[T]`?
21:21:23krux02Quelklef: in what context?
21:21:32krux02for the name?
21:21:35FromGitter<tim-st> he means the question mark
21:21:54krux02ah yea
21:21:59krux02I don't know
21:22:07krux02I agree that Option[T] is too verbose
21:22:18krux02but T? is too short for my personal taste
21:22:26FromGitter<tim-st> I think the complete type isnt natural
21:22:50FromGitter<tim-st> when in mathmatics lessons you learnt about option[T].
21:22:52FromGitter<tim-st> ?
21:22:54FromGitter<tim-st> I didnt
21:22:55krux02but nim doesn't have a postfix operator
21:23:06krux02(except the * for exporting symbols)
21:23:22krux02so you woul need to make it a prefix operator
21:23:28krux02? T
21:24:15krux02template `?`[T](_: typedesc[T]): untyped = Option[T]
21:24:27*cspar quit (Ping timeout: 240 seconds)
21:25:19krux02I think I would be ok with a shorter name `Opt[t]`
21:25:38krux02Option should be used often, and therefore shouldn't be so verbose.
21:25:54krux02or maybe just Op[T]
21:26:17krux02or as a builtin prefix like ptr or ref
21:26:24*cspar joined #nim
21:26:32FromGitter<tim-st> I have to ask again about streams: when I do setPosition(index) does it have a bad performance?
21:26:53krux02pro foobar(a: ptr A; b: ref B; c: var C; d: opt D)
21:27:11*yglukhov[i] quit (Remote host closed the connection)
21:27:30krux02tim-st: I don't know, but is `setPosition` even universally allowed?
21:27:45krux02I am thinking about processing stdin
21:27:51krux02and stdout
21:28:14krux02but maybe we talk about something entirely different.
21:28:16FromGitter<tim-st> I mean only on files
21:28:47krux02my suggestion is, test it, becaues I don't know
21:28:51FromGitter<tim-st> https://nim-lang.org/docs/streams.html#setPosition,Stream,int
21:29:01krux02but jumping around arbitrarily in memory is never free
21:29:12FromGitter<tim-st> ok, thanks
21:29:21krux02even if the memory is already in ram, they you will still have a chache miss.
21:29:30krux02so try to avoid jumping as much as possible
21:32:00FromGitter<Quelklef> @krux02 make it a special rule when parsing, which either then becomes `postfix(T, !"?")` or `bracketExpr(!"Option", T)` in the AST
21:32:16FromGitter<Quelklef> And disallow the `?` operator
21:33:13FromGitter<Quelklef> Actually, come to think of it, doing it prefix like `?T` would be nice
21:33:23FromGitter<Quelklef> Because it can just be implemented as a macro then
21:33:27FromGitter<Quelklef> I may even do that in my own code
21:33:38FromGitter<Quelklef> Also it wouldn't require special parsing
21:33:51FromGitter<Quelklef> But it's not quite as visually appealing as `T?` imo
21:34:32krux02it can be implemented as a template and I posted the code up there
21:34:48FromGitter<Quelklef> Was that part of your PR?
21:34:51FromGitter<Quelklef> Didn't see it, my bad
21:34:53krux02no
21:34:56FromGitter<Quelklef> oh
21:35:03krux02template `?`[T](_: typedesc[T]): untyped = Option[T]
21:35:08krux02it was here in the chat
21:35:10FromGitter<Quelklef> yeah
21:35:14FromGitter<Quelklef> ok
21:35:15FromGitter<Quelklef> mb
21:35:16krux02````template `?`[T](_: typedesc[T]): untyped = Option[T]````
21:35:20FromGitter<Quelklef> ah i see
21:35:23krux02maybethat is better to see
21:35:33krux02not tested though
21:35:49FromGitter<Quelklef> Why the single arg?
21:36:22FromGitter<Quelklef> not just ``template `?`[T: typedesc]: untyped = Option[T]``
21:36:38FromGitter<Quelklef> Wait, not just ``template `?`[T]: untyped = Option[T]``
21:36:50krux02well try what works best
21:36:57krux02to my experience the single arg works best
21:37:20FromGitter<Quelklef> ...does it not require an argument, though?
21:37:30FromGitter<Quelklef> Or does `_` do something special as a parameter
21:37:33Demos[m]tried rust again. I like nim better :<>
21:37:45FromGitter<Quelklef> : }
21:37:58dom96:(){}<>
21:38:11krux02the `_` is a parameter that tells the compiler: "I don't really use this parameter, I know, don't tell me that in a warning please"
21:38:25FromGitter<Quelklef> In the body
21:38:28FromGitter<Quelklef> But
21:38:47FromGitter<Quelklef> Ah, I get it now
21:39:01krux02good :)
21:39:05FromGitter<Quelklef> because `?int` is `` `?`(int) ``, not `` `?`[int] ``
21:39:14krux02yes
21:39:29dom96Demos[m]: Now write a blog post :D
21:39:45krux02you would need to write `` ?[int]() ``
21:40:01FromGitter<Quelklef> I think it can be done with no `()`? But yeah
21:40:20krux02with just generic parameters? I don't think so
21:41:11krux02I think the design of `typedesc` is a bit broken
21:41:13FromGitter<Quelklef> !eval template x[T] = T; echo(seqx[int (1, 2, 3))
21:41:14NimBotCompile failed: in.nim(1, 34) Error: ']' expected
21:41:27FromGitter<Quelklef> oh no
21:41:29FromGitter<Quelklef> the formatting again
21:42:37krux02!eval template x[T] = T; echo(seq[x int](1, 2, 3))
21:42:39NimBot<no output>
21:43:22FromGitter<Quelklef> Curiously, it fails on my machine
21:43:37krux02what fails?
21:43:40FromGitter<Quelklef> Wait, I'm doing something else
21:43:58FromGitter<Quelklef> Which also isn't related to the question
21:44:04FromGitter<Quelklef> hold on
21:44:12FromGitter<Quelklef> !eval template x[n] = 2; echo(x[4])
21:44:14NimBot<no output>
21:44:25FromGitter<Quelklef> hmmm
21:45:05FromGitter<Quelklef> Something's fucky
21:45:30FromGitter<Quelklef> ok, here, this works:
21:45:42FromGitter<Quelklef> ```template x[t] = ⏎ echo "neat" ⏎ x[int]``` ⏎ ⏎ outputs "neat" [https://gitter.im/nim-lang/Nim?at=5b510686c579673e6b80ad31]
21:47:03FromGitter<krux02> interesting
21:47:08FromGitter<krux02> got: <string> ⏎ but expected: <T>
21:47:14FromGitter<krux02> that is a bug in Nim
21:47:24FromGitter<krux02> because of the broken `typedesc` thing
21:47:39FromGitter<Quelklef> For the `?` template?
21:47:45FromGitter<krux02> how is "expected: <T>" an error
21:47:46FromGitter<krux02> yes
21:47:51FromGitter<Quelklef> Hmm
21:48:14FromGitter<krux02> the typedesc thing needs to die in the Nim language
21:48:37FromGitter<Quelklef> I got the same error
21:48:39FromGitter<Quelklef> Why
21:48:40FromGitter<Quelklef> ?
21:49:23FromGitter<Quelklef> Also, just do ``template `?`(T: untyped): untyped = Option[T]``. It's as type-safe.
21:50:10krux02yes that might be true
21:50:42FromGitter<Quelklef> It is, given that T has no constraints and is only the type for one variable
21:50:52krux02yes
21:50:58krux02I am just used to my pattern that is all
21:51:07krux02I use many overloads
21:51:51krux02template sometypeprop(_: typedesc[MyType]): string = "mypropfrommytype"
21:53:25*chopzwei quit (Ping timeout: 250 seconds)
22:08:07PMunchHmm, this is troublesome..
22:08:22PMunch>= is rewritten as not <=
22:08:36PMunchWhich means that the logic I need for options completely breaks down..
22:10:37PMunchAraq, why doesn't Nim handle overrides for >= and != ?
22:11:00PMunchI get that it's easier to implement one operations instead of both, but for this stuff I really need both..
22:13:07FromGitter<Quelklef> PMuch, I think it's more than that
22:13:32PMunchHow so?
22:13:40FromGitter<Quelklef> In essence, I think the idea is also: if you need to define more than `<` and `!=`, you're doing it wrong
22:13:55FromGitter<Quelklef> Because comparison operators should implement a natural (?) ordering
22:14:07PMunchWell, they do in this case..
22:14:12FromGitter<Quelklef> Which is sufficiently specified by `<` and `!=`
22:14:16FromGitter<Quelklef> Wait, why do you need both, then?
22:14:39FromGitter<Quelklef> If it's a n ordering, then `>=` should be equiv to `not <=`, right?
22:14:48PMunchThey return their first option when the condition is true
22:15:01PMunchSo some(100) >= some(42) return some(100)
22:15:12FromGitter<Quelklef> Don't use `>=` then
22:15:13FromGitter<Quelklef> imo
22:15:52PMunchWhy? It makes perfect sense..
22:16:06PMunchI guess I could add some obscure >=? things..
22:16:11PMunchBut that would look a bit messy..
22:16:31PMunchWould make it more obvious though what is going on
22:20:28FromGitter<Quelklef> Because I expect `>=` to return a boolean
22:20:51FromGitter<Quelklef> suddenly `if some(100) >= some(42): echo("")` doesn't work
22:21:09FromGitter<Quelklef> Because a comparison operator doesn't return a boolean
22:22:34PMunchSorry, my keyboard ran out of battery -_-
22:22:39FromGitter<Quelklef> np
22:22:59PMunchThat actually does work as options implicitly converts to their has-ity when used as booleans
22:23:36PMunchsome some(100) >= some(42) returns some(100) which has a value (a true has-ity) and returns true
22:24:48FromGitter<Quelklef> !eval import options; if some(1): echo("huh")
22:24:49NimBotCompile failed: in.nim(1, 24) Error: type mismatch: got <Option[system.int]> but expected 'bool'
22:24:52FromGitter<Quelklef> Hm
22:25:01FromGitter<Quelklef> Apparently
22:25:04FromGitter<Quelklef> Apparently not*
22:25:09PMunchyet*
22:25:09FromGitter<Quelklef> Also I'll BRB gonna pick up food
22:25:20PMunchI'm working on a PR for the options module
22:25:26PMunchWhich adds a lot of neat stuff :)
22:25:36PMunchReally fleshes out the concpet
22:25:39PMunchconcept*
22:28:45*skrylar joined #nim
22:35:34skrylaris the soap-pocalypse still happening?
22:41:02*icebattle quit (Quit: leaving)
22:52:01FromDiscord<awr> what is the "soap-pocalypse"
22:54:29*cspar quit (Ping timeout: 260 seconds)
23:04:13PMunchkrux02, just updated my PR https://github.com/nim-lang/Nim/pull/8358
23:04:25PMunchIt's pretty neat!
23:04:34PMunchBut now it's really time for bed :P
23:04:34*PMunch quit (Quit: leaving)
23:04:35*cspar joined #nim
23:07:35*mwbrown quit (Ping timeout: 240 seconds)
23:10:10*mwbrown joined #nim
23:27:56*ng0 quit (Quit: Alexa, when is the end of world?)
23:42:09*xylef joined #nim
23:45:36*icebattle joined #nim
23:51:37FromGitter<citycide> PMunch: you're out by now but it seems odd to me that `==` returns an Option.. is that a thing elsewhere?