00:00:47 | FromGitter | <Quelklef> hmm |
00:03:19 | FromGitter | <Quelklef> Is Nim's philosophy on errors different from Python's |
00:03:37 | FromGitter | <Quelklef> ? I suspect that's why I feel gross about IndexError being fatal |
00:04:49 | FromGitter | <kayabaNerve> @Quelklef Probably. I didn't read the RFC; just your comment. |
00:05:19 | FromGitter | <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:18 | zacharycarter | Quelklef: you have to consider the target compilation backends / python's runtime |
01:49:43 | zacharycarter | I assume that some things that are possible with a python runtime, won't be possible with a static C compilation |
01:49:49 | zacharycarter | like recovering from invalid memory access errors etc |
01:53:07 | zacharycarter | https://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:03 | zacharycarter | vs - https://kb.iu.edu/d/aqsj |
01:54:18 | zacharycarter | so the answer is in Python's runtime - which Nim lacks |
01:55:39 | zacharycarter | and this boils down to python's bytecode to machine code compilation process I think |
01:55:57 | zacharycarter | there's a chance there to handle these exceptions and do something with them |
01:58:00 | zacharycarter | Also - 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:51 | zacharycarter | although 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:02 | FromGitter | <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:31 | skrylar | yes, Maybe types are great. |
02:08:11 | skrylar | I 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:19 | FromGitter | <rayman22201> > *<Araq>* sure, people are free to use them. I don't. |
02:11:31 | FromGitter | <rayman22201> lol. Araq has strong opinions about things :-P |
02:12:36 | skrylar | its hard to do a good job with weak opinions |
02:13:01 | FromGitter | <rayman22201> Agreed. I <3 this about Araq actually. |
02:14:28 | FromGitter | <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:42 | FromGitter | <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:37 | skrylar | i suppose that requires some deep introspection on whether checks that can be elided in release builds should be catchable in debug builds |
02:20:20 | skrylar | although 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:05 | FromGitter | <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:05 | skrylar | he's been talking about going in a rustlike direction for a couple days |
02:23:26 | skrylar | it's not the worst way to handle memory |
02:23:59 | FromGitter | <rayman22201> Steal the best parts of other languages lol! I'm all for it! |
02:24:04 | skrylar | GCs 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:18 | skrylar | borrowed/unique + weak ptrs are much simpler for a runtime to implement tho |
02:26:51 | FromGitter | <gogolxdong> Is there a lib to translate python to nim? |
02:27:17 | FromGitter | <rayman22201> https://github.com/metacraft-labs/py2nim |
02:27:58 | FromGitter | <rayman22201> @skrylar I came to Nim from the desire for a less insane Rust, so I am ok with this :-) |
02:28:43 | FromGitter | <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:55 | skrylar | he said it was about trying to position for the embedded market |
02:35:15 | skrylar | i 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:15 | FromGitter | <rayman22201> I also think that is a good move as well. Nim can do really well there |
02:36:09 | FromGitter | <rayman22201> yup, exactly. I agree with this. |
02:36:51 | * | chopzwei quit (Ping timeout: 250 seconds) |
02:37:44 | FromGitter | <gogolxdong> doesn't compile. |
02:38:17 | skrylar | adventures of SOAP serialization? |
02:38:20 | zacharycarter | rayman22201: 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:53 | FromGitter | <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:54 | FromGitter | <gogolxdong> yes ,I 'm trying to translate vmware python SDK to nim but found overwhelming. |
02:39:08 | zacharycarter | py2nim doesn't make any sense |
02:39:12 | zacharycarter | C2nim does |
02:39:15 | zacharycarter | P2nim does not |
02:39:23 | zacharycarter | Py2nim* |
02:39:43 | zacharycarter | how are you going to go from a higher level abstraction to a lower one through an automated process? |
02:39:45 | FromGitter | <gogolxdong> vmware uses SOAP. |
02:40:18 | skrylar | git init irishspring |
02:40:24 | zacharycarter | SOAP is fine for server to server communication / RPC but you'd be better off with binary serialization protocol IMO |
02:40:30 | zacharycarter | if your use case is client to server - use REST or HTTP |
02:40:38 | FromGitter | <gogolxdong> its python SDK code is auto-generated too |
02:40:52 | zacharycarter | well yeah - autogenerating soap envelopes isn't that hard |
02:40:53 | skrylar | zacharycarter, ey doesn't control the wire, it's a client lib |
02:40:59 | zacharycarter | the thing is - not many people are using SOAP anymore |
02:41:08 | zacharycarter | ah gotcha |
02:41:15 | FromGitter | <rayman22201> @zacharycarter I see. Your logic is still flawed though. The bytecode step is not why Nim handles exceptions differently |
02:41:26 | skrylar | arguably saying to use REST instead of SOAP is an invalid sentence |
02:41:44 | skrylar | REST is an endpoint and command designator, it still carries a payload |
02:41:48 | zacharycarter | well - I wasn't sure - I was just thinking it would be a place to catch an invalid memory access error |
02:42:22 | zacharycarter | not sure how Python doesn't segfault |
02:42:36 | skrylar | the 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:54 | zacharycarter | REST is just a paradigm right? SOAP is a communication protocol |
02:42:55 | zacharycarter | my point is - if you're using SOAP - you're most likely using it over HTTP these days |
02:42:58 | zacharycarter | so why not just abandon it? |
02:43:08 | skrylar | because he doesn't control the protocol |
02:43:17 | zacharycarter | gotcha |
02:43:30 | FromGitter | <rayman22201> He is trying to write VMware client. Can't change VMware |
02:44:00 | zacharycarter | ugh yeah - generating SOAP clients isn't fun either |
02:44:00 | zacharycarter | lots of XML parsing |
02:44:13 | skrylar | and yes, REST is basically just using http as a payload carrier ;p |
02:44:33 | FromGitter | <rayman22201> indeed. sad pandas |
02:44:44 | skrylar | well generating the messages is not so hard; i have done this with flatbuffers and protobuf already |
02:44:54 | skrylar | parsing depends on if you are doing sax or dom parsing |
02:45:12 | skrylar | dom parsing (preload whole input to xml, get dom, then query recursively) easier but more ram intensive |
02:45:19 | zacharycarter | well SOAP has all sorts of shit baked into it |
02:45:22 | zacharycarter | like security etc |
02:45:39 | zacharycarter | like - 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:53 | zacharycarter | although I was dealing with TIBCO business works at the time - which didn't help things- but still, it was hell |
02:46:00 | skrylar | securing anything is bound to be a trouble |
02:46:24 | FromGitter | <rayman22201> SOAP is a shit show. Sadly a lot of larger corporate entities still use it... |
02:46:34 | zacharycarter | dude - 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:45 | zacharycarter | now he's advocating for installing anti virus solutions in our docker images |
02:46:54 | FromGitter | <rayman22201> hahahahaha |
02:47:11 | skrylar | why am i not surprised |
02:47:11 | zacharycarter | I keep saying - if you care this mucha bout PCI compliance - fucking run OpenBSD and use pledge or some other sandboxing solution |
02:47:14 | zacharycarter | don't containerize |
02:47:54 | zacharycarter | I've never met someone before who can read the same sentence as me and interpret it in an entirely different manner |
02:48:07 | skrylar | i don't think pci says anything about containerizing, but i have heard people tend to put them on separate networks |
02:48:08 | zacharycarter | he's like - okay, we need PCI compliance - AWS says their fargate service is AWS complaint |
02:48:17 | zacharycarter | we all go read the AWS docs about fargate being compliant - yep it's compliant! |
02:48:31 | zacharycarter | he comes back and says well - AWS says fargate CAN be compliant |
02:48:39 | FromGitter | <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:40 | zacharycarter | and we're all like - no... it says it is |
02:48:50 | zacharycarter | so here we are discussing anti-virus solutions for containers |
02:48:53 | zacharycarter | kill me |
02:49:24 | FromGitter | <rayman22201> Have the guy call / email your AWS rep? |
02:49:33 | FromGitter | <Quelklef> @zacharycarter I think you're severely misunderstanding that SO post. The OP's code is not doing any exception handling. |
02:50:25 | zacharycarter | that's not why I was linking the SO post |
02:50:38 | zacharycarter | I was linking it to differentiate the differences between how python is compiled / interpreted vs C |
02:50:44 | FromGitter | <gogolxdong> @rayman22201 from auto generated code by unknow method to auto generated code by macro , yes. It's sad. |
02:50:53 | FromGitter | <Quelklef> Ah |
02:50:55 | zacharycarter | I have no idea why the exceptions are managed vs unmanaged |
02:51:03 | zacharycarter | I was just guessing |
02:51:05 | zacharycarter | https://github.com/stoneyrh/gSOAP |
02:51:13 | zacharycarter | maybe write bindings to that gogolxdong |
02:51:42 | FromGitter | <rayman22201> @gogolxdong and @zacharycarter I was about to suggest the same |
02:51:58 | FromGitter | <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:44 | zacharycarter | well with Nim going up from C is always easier |
02:52:45 | zacharycarter | the reverse is almost always impossible |
02:52:55 | zacharycarter | although it's definitely possible to invoke Python / Java from Nim |
02:53:31 | zacharycarter | I'd find a C/C++ SOAP library and bind to it with C2nim / nimgen |
02:53:46 | zacharycarter | you can probably have a working solution in a few hours if you know what you're doing |
02:53:58 | skrylar | bribe skrylar to write it [lol] |
02:54:06 | zacharycarter | there's that too :P |
02:54:32 | zacharycarter | or you can pay me once I quit my job in the near future and become a full time Nim developer |
02:54:43 | zacharycarter | I'm just going to pay myself somehow |
02:55:21 | zacharycarter | can't deal with these people telling me to antivirus my docker containers anymore |
02:55:47 | FromGitter | <rayman22201> I like your moxy @zacharycarter. Good for you! |
02:56:12 | zacharycarter | :P |
02:56:44 | skrylar | xml has some interesting metadata challenges admittedly |
02:56:55 | zacharycarter | it'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:19 | skrylar | like 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:24 | zacharycarter | I'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:35 | skrylar | you have to check the last entry in an array for container attributes in ink files |
02:57:42 | zacharycarter | currently reading - https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319 |
02:58:05 | zacharycarter | what is Ink? |
02:58:29 | skrylar | something you use to write on paper [https://www.inklestudios.com/ink/] |
02:58:54 | * | Jesin joined #nim |
02:59:12 | zacharycarter | oooo |
02:59:12 | skrylar | there 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:31 | skrylar | but they use a stack-machine with json bytecode |
02:59:51 | skrylar | this is one of those times you should have used XML |
02:59:52 | zacharycarter | when 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:21 | skrylar | because we could just have >container name="thing"> instead of [..., ..., {"n"="thing"}] |
03:00:22 | zacharycarter | yeah - people are terrible at picking the right markup language traditionally |
03:00:50 | skrylar | they did it because you can use newton.json.dll to slurp the file |
03:01:18 | skrylar | godot 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:18 | zacharycarter | like I was trying to port Horde3d at one point and they had all their config in xml |
03:01:36 | skrylar | toml is okay |
03:01:43 | zacharycarter | I hate godot tbh |
03:01:53 | skrylar | i actually wrote rfc3339 because thats the date format TOML uses |
03:01:55 | zacharycarter | Their BDFL / core devs are clueless when it comes to writing a game engine |
03:02:03 | skrylar | wat |
03:02:14 | zacharycarter | dude - read this post, let me find it |
03:02:20 | skrylar | their core devs used to ship mobile games, 2.x actually had more sanity to it than unity does |
03:02:30 | skrylar | 3.x i dunno. they removed the atlas exporter :( |
03:02:37 | zacharycarter | https://godotengine.org/article/why-does-godot-use-servers-and-rids |
03:03:00 | zacharycarter | this part is the best |
03:03:01 | * | zacharycarter sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/OoNWzSTyjULgPIdvggfSdumY > |
03:03:09 | skrylar | i had a minute curiosity for monogame but two years and they still have not added support for GLSL shaders on linux |
03:03:17 | skrylar | "just get a windows machine to compile your shaders" get fucked |
03:03:48 | zacharycarter | we need to roll our own with BGFX IMO |
03:04:22 | skrylar | Meh, i plan to actually ship somethign someday |
03:04:46 | zacharycarter | we need to port - https://github.com/nem0/LumixEngine / https://github.com/volcoma/EtherealEngine |
03:04:47 | skrylar | re-engineering things godot just does for me for no reason other than NIH doesn't appeal to me |
03:05:20 | zacharycarter | well this is another thing i crossed paths with with the godot devs |
03:05:46 | zacharycarter | #1 question - why write your own renderer, why not use BGFX when you're going to inevitibly face the deprecation of OpenGL |
03:05:51 | FromGitter | <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:15 | zacharycarter | their answer - we're make our own BGFX |
03:06:18 | zacharycarter | okay! have fun! |
03:06:20 | zacharycarter | I know the creator of BGFX is one of the best C++ graphics programmers I've ever encountered |
03:06:21 | zacharycarter | but I'm sure you guys can do better |
03:06:43 | FromGitter | <rayman22201> I stepped away for 5 minutes and lost all context.... lol |
03:06:47 | skrylar | bgfx doesn't really -do- much though |
03:06:58 | zacharycarter | rayman22201: thank you! I have a arm architecture book that's next on my list, and then I'm tackling data structures / algos |
03:07:13 | skrylar | i 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:26 | zacharycarter | well plus metal |
03:07:38 | zacharycarter | and actually it does do a lot |
03:07:45 | skrylar | i would like to see a rebol shader compiler :3 but eeh |
03:08:06 | zacharycarter | it provides a single API for interfacing with whatever graphics API is preferred for the architecture / cpu the program is running on |
03:08:17 | zacharycarter | so you don't have to write for direct x or opengl or metal or whatever |
03:08:29 | zacharycarter | you just write for bgfx, and bgfx handles the draw calls - not to mention, in an optimized fashion |
03:08:47 | skrylar | my mac is too old for metal iirc so . |
03:08:55 | zacharycarter | you don't have to do draw call bucket sorting, etc |
03:09:10 | zacharycarter | bgfx is more relevant than ever with what apple just did IMO |
03:09:20 | skrylar | i have a rebol lexer on hand. should probably fiddle the parser to completion as well :\ |
03:09:42 | zacharycarter | in fact - I'm seeing a lot of game engine BDFLs talk to Branimir (BDFL of BGFX) and tell him he was right |
03:09:53 | zacharycarter | when they second guessed him in the first place |
03:10:01 | skrylar | why does everyone keep talking about bdfls all the sudden |
03:10:08 | skrylar | it's like guido happens and its a global meme now |
03:10:17 | zacharycarter | I think the acronym has just caught on |
03:10:28 | zacharycarter | I started using it as soon as I could associate it with Araq |
03:10:29 | skrylar | we have been calling them maintainers for 20 years |
03:10:36 | zacharycarter | and then I would talk about Araq at work as the BDFL |
03:11:13 | skrylar | anyway yes, bgfx is nice. |
03:11:16 | zacharycarter | people would be like - wtf is a BDFL, and then I'd get to launch into a whole explanation about Nim and Araq |
03:11:21 | skrylar | the reason i use godot is because it offers me the tooling |
03:11:37 | zacharycarter | godot is the best option we have - for sure atm |
03:11:51 | zacharycarter | but I want to write a game engine in pure Nim that can compete and do better |
03:11:51 | FromGitter | <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:05 | FromGitter | <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:35 | zacharycarter | rayman22201: Varriount and I live near eachother / have met up to nerd out |
03:13:00 | skrylar | zacharycarter, game engines are always super prone to NIH syndromes. personally, i would rather see tools that were independenly useful but offered integrations |
03:13:25 | FromGitter | <rayman22201> lol. Then tell him to get on IRC :-P. OK I have to go for realz now |
03:13:42 | zacharycarter | skrylar - 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:54 | skrylar | in 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:10 | skrylar | the new engine makes you keep a stream object per-sound in the tree which is kind of bogus |
03:14:31 | zacharycarter | I mean the fact that stupid ass GDScript still exists bugs me |
03:14:45 | skrylar | people like to whine about gdscript but it works |
03:14:55 | zacharycarter | well - I see it as another thing to maintain |
03:15:05 | zacharycarter | it's like UnrealScript |
03:15:15 | zacharycarter | or booscript |
03:15:17 | skrylar | the reason some of those exist is because they do things different |
03:15:18 | zacharycarter | and we all saw how those worked out |
03:15:28 | skrylar | gdscript is meant to be clipped on to nodes and be all over the place; lua doesn't really do that |
03:15:42 | zacharycarter | no one wants to learn them, no one wants to maintain / keep them up to date with the engine |
03:15:43 | skrylar | and 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:24 | zacharycarter | yeah - lua isn't the best answer either |
03:16:33 | skrylar | Unity 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:39 | zacharycarter | but 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:47 | zacharycarter | UE4 IMO gets it right |
03:17:02 | zacharycarter | visual scripting - if you don't want that, dive into C++ |
03:17:09 | zacharycarter | and you can add whatever scripting layer you want to if you really want |
03:17:10 | FromGitter | <gogolxdong> If you guys master python ,guide me somehow , https://github.com/gogolxdong/pyvmomi |
03:17:28 | skrylar | i tend to disregard a lot of language complaints in this case because they usually sound like whining |
03:17:34 | skrylar | "it's not C++ so its shit" |
03:17:54 | zacharycarter | I just don't want to have to learn a language / syntax I'm going to use in one capacity |
03:17:57 | zacharycarter | that shit is annoying |
03:18:01 | skrylar | my 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:12 | skrylar | the syntax is like 99% python |
03:18:37 | zacharycarter | doesn'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:44 | zacharycarter | deal with their inefficiencies, like you just described |
03:18:55 | skrylar | this is true of literally everything |
03:19:19 | zacharycarter | yeah - but the difference is, I might be able to use that other language outside of Godot |
03:19:31 | zacharycarter | this is the same problem I had with UDK / Unrealscript |
03:19:41 | zacharycarter | I learn your bullshit language so I can write games for your engine |
03:19:51 | skrylar | to be fair to unreal, unrealscript was made before there even were commodity scripting engines |
03:20:07 | zacharycarter | no way - angelscript, lua C++ engines existied back then |
03:20:16 | skrylar | in '91? |
03:20:24 | zacharycarter | I'm talking about like UE3 |
03:20:31 | zacharycarter | which had unrealscript still |
03:20:43 | zacharycarter | UE4 was the first engine to ditch it and just go C++ and visual scripting |
03:21:05 | skrylar | anyway, i couldn't care less. |
03:21:07 | zacharycarter | bring your own scripting language if you want it |
03:21:11 | zacharycarter | we open source the engine - you do what you want with it |
03:21:14 | skrylar | if it were up to me things would be in smalltalk or similar |
03:21:25 | zacharycarter | have you looked at Godot's source code? |
03:21:25 | zacharycarter | :P |
03:21:35 | zacharycarter | well we can at least agree that smalltalk is the shiz |
03:21:50 | skrylar | smalltalk v. rebol has me in a conundrum |
03:22:01 | skrylar | rebol syntax is so easy to parse and ply around that i've already done 80% of it |
03:22:41 | zacharycarter | lol |
03:22:58 | skrylar | but it does read backwards. |
03:23:24 | skrylar | something: dot vec1 vec2 * 2 (i don't do what you think i do) |
03:23:28 | zacharycarter | yeah - it's like Nim vs Rust |
03:23:42 | zacharycarter | no one knows about the former |
03:24:18 | skrylar | smalltalk sort of obliges you to write a devkit because the language is literally incomplete without a gui |
03:24:37 | skrylar | although with modern stuff, the verbosity is a non-issue |
03:25:08 | zacharycarter | what implementation do people even use now adays? |
03:25:12 | skrylar | pharo |
03:25:20 | skrylar | (though gemstone and visualworks still live) |
03:25:55 | zacharycarter | I 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:31 | skrylar | rebol 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:47 | skrylar | you literally cannot parse `dot v1 v2` without knowing already that dot is a function |
03:26:48 | zacharycarter | ooph |
03:27:32 | skrylar | Pharo is neat but they have no real priority towards say, tree shaking |
03:27:53 | skrylar | and polymorphing objects at runtime is hard to code (if you're doing your own ST) |
03:28:52 | skrylar | ST's technically have a fixed layout in memory, so you have to stop the world to rewrite all references to a struct |
03:29:23 | zacharycarter | what is a ST? |
03:29:55 | skrylar | smalltalk-80 == ST-80 |
03:30:16 | zacharycarter | ah okay |
03:31:39 | skrylar | it would be pretty funny to write shaders in smalltalk. |
03:31:43 | skrylar | i think everyone would hate it |
03:33:23 | zacharycarter | haha - well writing shaders is a PITA anyway |
03:33:44 | zacharycarter | it'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:17 | zacharycarter | one thing I could never figure out how to do well is set up a cross compilation pipeline with BGFX projects |
03:34:25 | zacharycarter | I 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:32 | zacharycarter | I wonder how the big boys do it |
03:34:54 | skrylar | they either write every shader multiple times, or they write an in-house shader compiler (ex. unity or ogre's shader engines) |
03:35:06 | skrylar | bgfx shaders are text files that get abused by a C preprocessor |
03:35:08 | zacharycarter | yeah but what about the binaries |
03:35:31 | zacharycarter | how do you develop on a windows machine and produce a binary that will run on OSX? |
03:35:53 | skrylar | one does not cross compile to mac |
03:36:01 | skrylar | tim's garden does not like it |
03:36:17 | zacharycarter | well linux whatever |
03:36:35 | skrylar | you generally cross compile from linux to windows, if at all |
03:36:45 | zacharycarter | like I know when I made frag I needed to produce windows binaries |
03:36:47 | skrylar | otherwise you have a build slave that runs natively on that OS and does the |
03:36:50 | skrylar | build |
03:36:55 | zacharycarter | so it was - write a docker image to install all the mingw shit I needed to cross compile my binary for windows |
03:37:13 | zacharycarter | so when you install UE4 - you're installing the cross compilation toolchain too then I guess? |
03:37:14 | skrylar | i never learned docker. this is a character flaw |
03:37:56 | zacharycarter | the 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:12 | skrylar | well 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:34 | skrylar | if you make os calls then you need the headers as well |
03:39:09 | zacharycarter | yeah - that was the thing - I was definitely making OS / filesystem calls |
03:39:22 | skrylar | were they done through a platform shim? |
03:39:49 | zacharycarter | well - through Nims stdlib so I guess so |
03:39:57 | skrylar | Dunno then |
03:40:07 | zacharycarter | here's what I had to do - |
03:40:08 | zacharycarter | https://github.com/fragworks/frag/blob/master/Dockerfile |
03:40:32 | zacharycarter | https://github.com/fragworks/frag-android/blob/2cb58226a7df4baf13192bf941803c9747e0a4b4/Dockerfile |
03:40:40 | zacharycarter | so that's android compilation |
03:40:42 | skrylar | bleh. may keep with rebol for shaders. people like their text editors |
03:40:55 | skrylar | one of the largest complains with smalltalk is "i can't use my precious text editor with it" |
03:41:46 | skrylar | well, i used rkt a few times |
03:42:00 | skrylar | they have something similar to dockerfiles. but local image reuse was broken at the time |
03:42:13 | zacharycarter | well - it's just very confusing |
03:42:35 | zacharycarter | like 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:37 | skrylar | ineed to set jenkins back up to test nimble packages between stable and master |
03:42:47 | zacharycarter | ugh fuck jenkins |
03:42:47 | skrylar | you don't |
03:42:48 | zacharycarter | gitlab |
03:42:54 | skrylar | you have build slaves =p |
03:43:00 | zacharycarter | hahaha |
03:43:15 | zacharycarter | yeah but I mean if someone installs UE4 / Unity they don't have build slaves |
03:43:38 | zacharycarter | also how do you handle testing? |
03:43:45 | skrylar | i'm pretty sure a multimillion dollar studio has found a way to license compiler tech :| |
03:44:00 | skrylar | although crossing from anything to android is not special |
03:44:12 | zacharycarter | like okay sure your program compiles, but what about RTEs? |
03:44:27 | skrylar | the normal way to build android is to cross to android, using the sdk+gcc+(whatever dex got replaced with) |
03:44:34 | zacharycarter | omg dude - the android NDK is somewhere you never want to go |
03:44:51 | zacharycarter | been there - never want to go back |
03:45:02 | skrylar | although one thing i read is apparently crossing to raspi is broken or something |
03:45:12 | skrylar | the last time i went 'there' they said to do hilarious things with distcc |
03:45:32 | skrylar | i guess distcc can pick up ARM build jobs from non-ARM hosts as long as the ARM host kicks the job off |
03:45:41 | zacharycarter | lol |
03:45:49 | zacharycarter | linux is great |
03:46:51 | skrylar | blegh. i have more yaks to shave tonight |
03:46:56 | zacharycarter | oh I didn't realize what distcc was |
03:47:08 | zacharycarter | interesting |
03:47:29 | skrylar | what 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:01 | skrylar | CCD and Fabrik are ... simpler than i thought ik solvers were |
03:48:53 | zacharycarter | I've done zero with IK - inverse anything scares me |
03:49:30 | zacharycarter | add the word kinematics to the situation and I'm out |
03:49:32 | skrylar | i 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:57 | skrylar | ubisoft 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:01 | zacharycarter | yeah the guy(s) that wrote that engine are stupid talented / smart |
03:50:18 | skrylar | http://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:47 | skrylar | basic geometry |
03:51:56 | FromGitter | <Varriount> Whatcha up to zacharycarter? |
03:52:09 | skrylar | varriount werent you part of this vmware sdk soap business |
03:53:18 | zacharycarter | Varriount: 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:51 | zacharycarter | I 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:01 | zacharycarter | supposedly 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:01 | zacharycarter | how are you? |
03:55:41 | zacharycarter | skrylar: lol the 41 steps got me |
03:56:36 | zacharycarter | I'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:51 | skrylar | I am not so special |
03:57:37 | zacharycarter | meh - 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:41 | skrylar | the other night i was having issues comprehending lattice deformation even though i know what it "does" |
03:58:09 | skrylar | the only authorative source i found was a vague description of a gdc post saying its just bone deformation with cubic interpolated weights |
03:58:13 | skrylar | :| |
03:58:24 | zacharycarter | lol |
03:58:31 | zacharycarter | so helpful |
03:58:38 | * | yglukhov[i] quit (Ping timeout: 255 seconds) |
03:59:08 | skrylar | one day i would like to see the nim-native voiceloop working, but i have to fight off arraymancer bugs |
03:59:41 | zacharycarter | that'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:31 | zacharycarter | you 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:40 | skrylar | riir? |
04:00:44 | skrylar | the trick is to start reading them and then desperately google how to read them |
04:00:47 | zacharycarter | rewrite it in rust |
04:01:04 | zacharycarter | :P |
04:01:05 | skrylar | the only time i ever tried to write in rust i broke the stdlib |
04:01:27 | zacharycarter | yeah well if you're not doing that or fighting the borrow checker you're doing something wrong probably |
04:01:27 | skrylar | i break the nim compiler all the time but at least that's because i did something silly |
04:01:49 | skrylar | "this is a public template that calls a non-public module function" -> boom |
04:01:51 | zacharycarter | so much rust hype at work from people who have never written a lick of C++ |
04:01:56 | zacharycarter | lol |
04:02:28 | skrylar | maybe i should send in a pr that just does an 80x24 ascii bomb when you break the stdlib |
04:02:55 | skrylar | there 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:26 | zacharycarter | lmao |
04:03:56 | zacharycarter | I can't even convince people at work that debian is a better distro than alpine |
04:04:03 | zacharycarter | for docker base images |
04:04:23 | zacharycarter | people don't understand stepping down from root but they want to install antivirus on containers |
04:04:30 | skrylar | Okay you're going to have to sell me on that one |
04:04:50 | zacharycarter | okay alpine gets 1 100th of the attention that debian does |
04:05:03 | zacharycarter | 1 1000th is more like it |
04:05:32 | skrylar | alpine 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:33 | zacharycarter | small footprint and all - I guarantee the distro sees more vulnerabilities / less attention than any other distro |
04:05:36 | zacharycarter | not to mention muscl vs glibc |
04:05:40 | skrylar | also built-in grsec |
04:06:23 | skrylar | (although grsec is not even available to the public in beta form; i am quite sad) |
04:06:36 | skrylar | they tried to donate the work to linux but linus would rather play politics than fix his fucking OS |
04:06:51 | zacharycarter | well linux is a shitshow to begin with |
04:07:00 | skrylar | the amount that i want planbsd9 as an os is incalvulable |
04:07:06 | skrylar | *incalculable |
04:07:18 | zacharycarter | BUT - I would rather trust a distro that recives the majority of the communities attention |
04:07:48 | zacharycarter | well I've been screaming for openbsd at work for PCI compliance because I'm tired of this docker antivirus convo nonsense |
04:08:05 | skrylar | alpine 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:17 | skrylar | openbsd doesn't handle multiple cores last i checked |
04:08:25 | zacharycarter | also - I see so many alpine images that shoehorn glibc into them because they need it |
04:08:29 | skrylar | i poked a year or two ago and it was still choking on threading iirc |
04:08:51 | zacharycarter | I don't think it does either :/ |
04:09:02 | skrylar | i know rkt runs on bsd (which is part of why i cared) |
04:09:09 | zacharycarter | but 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:20 | skrylar | Rocket 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:36 | zacharycarter | I need to check out rocket then |
04:09:47 | skrylar | kubernetes gave rkt the green light |
04:10:37 | zacharycarter | well then this just brings so much more ammo to destroy my terrible architect |
04:10:38 | zacharycarter | thank you |
04:10:42 | skrylar | i dislike apt from the dev side, speaking of debian |
04:11:13 | skrylar | pacman 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:15 | zacharycarter | how come? |
04:11:22 | skrylar | debian has an ENTIRE DIRECTORY of beurocracy to fill out just to get a deb |
04:12:33 | skrylar | rpms are unpleasant but scriptable to work around |
04:12:45 | skrylar | pacman is literally i copy a template PKGBUILD file and then edit some fields, tell it how to run make |
04:12:49 | zacharycarter | gotcha |
04:13:44 | skrylar | procedurally debian is quite responsible; with the whole "we call it stable when ten days without a bug report happen" type thing |
04:13:51 | skrylar | it's just that their packaging system is bloated |
04:14:12 | skrylar | well, it goes from unstable to testing after ten days of no issues |
04:14:34 | zacharycarter | mmph - 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:01 | zacharycarter | my thought process went like this - |
04:15:21 | skrylar | well debian has a security team but they only care about stable (read: heavily outdated) releases |
04:15:39 | skrylar | alpine security is proactive (use more secure / responsible developers) |
04:15:44 | zacharycarter | I 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:30 | skrylar | are you running a hardened service or just testing code |
04:16:43 | skrylar | if you're testing nim code you should be building on the average devbox OS |
04:16:51 | zacharycarter | It'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:06 | zacharycarter | no this would be production code eventually |
04:17:15 | skrylar | production code isn't always hardened either |
04:17:27 | zacharycarter | but I mean - it doesn't seem like the people even running the show at my company know what they're doing |
04:17:40 | skrylar | they probably don't |
04:17:55 | zacharycarter | so I'm really just relying on kubernetes at this point |
04:17:58 | zacharycarter | and hoping whoever stands up our kube cluster knows what they're doing |
04:18:09 | skrylar | i have never used kube :\ |
04:18:16 | skrylar | i mean i like the whole terraform/nomad/kube concept? |
04:18:28 | zacharycarter | well |
04:18:34 | skrylar | well nomad and kube don't get along iirc |
04:18:42 | zacharycarter | nomad and kube are comparable |
04:18:50 | zacharycarter | terraform is built by the company that makes nomad |
04:19:09 | skrylar | i just know that i liked the ideas they had and especially being datafile driven you can shove them in Phabricator |
04:19:23 | zacharycarter | terraform 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:37 | skrylar | is it terrible? |
04:19:58 | skrylar | i 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:03 | zacharycarter | it's slightly better but at the same time way more frustrating than using the cloud native tooling each vendor provides IMO |
04:20:27 | zacharycarter | one sec |
04:20:33 | skrylar | i 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:02 | zacharycarter | maybe - not sure if kubernetes would support beamvm or not |
04:21:07 | skrylar | one 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:15 | skrylar | smalltalk can work this way as well |
04:21:15 | zacharycarter | erlang is amazing |
04:21:18 | zacharycarter | for enterprise software |
04:21:32 | skrylar | i had a conversation today where Wings3D came up (also an erlang thing) |
04:21:36 | zacharycarter | like if you want redundancy, scalability, fault tolerance, etc - there's no reason you shouldn't be using the beamvm |
04:21:40 | skrylar | I might have to peek in their code and spork some of it |
04:22:04 | skrylar | was 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:08 | zacharycarter | elixir + pheonix is where it's at for webapps |
04:22:22 | zacharycarter | well people are doing cool things w/ blender now |
04:22:33 | zacharycarter | https://armory3d.org/ |
04:22:36 | skrylar | you can do good jobs with blender, that is not the issue |
04:22:46 | skrylar | its that the core team is out of touch with the world |
04:23:02 | skrylar | PBR has been out for how long as standard practice? and they haven't moved a finger to support it? |
04:23:09 | skrylar | the community wrote cycles modules and they still aren't merged? |
04:23:16 | zacharycarter | oh - yeah - that I have no experience with but I believe it |
04:23:19 | zacharycarter | their GUI looks like it was created in a vaccum |
04:23:27 | skrylar | Ton doesn't give a shit about anything |
04:23:30 | skrylar | he just wants to make his short films |
04:23:44 | zacharycarter | lol |
04:24:02 | skrylar | they completely neglect the game industry and like, they had broken IK solvers for years |
04:24:16 | skrylar | and then i pop open these web pages and find out constriant-obeying IKs have been public knowledge forever |
04:24:23 | skrylar | and the animation industry uses them |
04:24:25 | zacharycarter | well look what happened to their "game engine" |
04:24:47 | skrylar | to be fair, if you do things too exotically everyone hates you ^^ |
04:25:04 | skrylar | haven't got the links still, but one example is that menus are considered horrible ideas in UX |
04:25:35 | zacharycarter | so put them everywhere! |
04:25:37 | skrylar | Sorting menus alphabetially is objectively better (because non-sorted menus are O(n) scanning, but sorted are O(log(n)) or something) |
04:25:39 | zacharycarter | and then make them only accessible through obscure hotkeys |
04:25:45 | skrylar | There was a real whitepaper journal study done on this |
04:25:58 | skrylar | they look weird as shit but they found people found features quicker |
04:26:07 | skrylar | also the long-abandoned pie menus are like usability gold |
04:26:30 | skrylar | for menus with less than i think 12 items |
04:26:43 | zacharycarter | when 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:57 | skrylar | because 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:02 | zacharycarter | and then found modo to be 100x more enjoyable to use than blender |
04:27:05 | skrylar | yes, modo is great |
04:27:24 | skrylar | but thats the difference 800$+ in licenses costs |
04:27:33 | skrylar | its like 2k these days i think? |
04:27:37 | zacharycarter | I'll pay it to not have to deal with blender |
04:27:40 | zacharycarter | yeah it's expensive |
04:27:44 | skrylar | i appreciate blender's spirit |
04:27:50 | skrylar | i don't trust modo now that the foundry owns them |
04:27:59 | skrylar | foundry loves them some DRM and luxology were traditionally anti-drm |
04:28:03 | * | xylef quit (Quit: WeeChat 2.2) |
04:28:18 | zacharycarter | I realized I wasn't going to be a 3d modeler after I made a killer 3d model |
04:28:45 | skrylar | well if i was going to waste my life making 3d modeling software i would start by duping wings3d/nendo |
04:28:54 | zacharycarter | and then couldn't unwrap / uv / bump map etc the model without doing everyting all over again with tears rolling down my face |
04:29:14 | skrylar | welcome to 2018 where UV mapping is for losers |
04:29:22 | skrylar | PTex \o/ |
04:29:33 | zacharycarter | I just gave up on making games |
04:29:38 | zacharycarter | I just want to make things that make games now |
04:29:43 | skrylar | 3d coat inspired me a bit |
04:29:44 | zacharycarter | because I realize making games is not going to happen |
04:29:49 | zacharycarter | 3d coat is the shit |
04:29:52 | zacharycarter | that software is amazing |
04:30:03 | skrylar | 3d 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:11 | skrylar | model and then polygonize is the way to go |
04:30:26 | skrylar | you can also google "kizamu sculpting" for something that only existed as a prototype; scultping with distance fields |
04:30:43 | zacharycarter | man voxels are so confusing lol |
04:30:50 | zacharycarter | like every year I see the same old voxel engine rehash about how it's going to be the next big thing |
04:30:53 | skrylar | distance fields are confusing |
04:30:56 | zacharycarter | and then like ten years later the same voxel engine looks the same |
04:30:56 | skrylar | voxels are easy |
04:31:28 | skrylar | i think my 'dream modeler' is wings with a distance field sculpter attached |
04:31:31 | zacharycarter | https://www.voxelfarm.com/index.html is the only guy I've found who really knows how to use voxels right |
04:31:44 | skrylar | well marching cubes was depatented recently |
04:31:45 | zacharycarter | his blog is ridiculous |
04:31:58 | skrylar | one of the core voxel patents was forcing everyone to use suboptimal tesselators forever |
04:32:08 | skrylar | and fixed pipeline GPUs meant we couldn't raytrace en masse |
04:32:32 | skrylar | now that we can program arrays of 900mhz CPUs, voxels and raytracing systems are coming back |
04:33:11 | skrylar | with voxels/distance fields, you can model by just purely sculpting details ex nilho |
04:33:17 | skrylar | worry about the polys later :3 |
04:33:41 | skrylar | actually distance fields allow mechanical modeling with adjustable welds, so you can contorl the way that boolean models merge together |
04:34:36 | skrylar | there 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:07 | zacharycarter | https://www.voxelquest.com/news/every-version-of-voxel-quest-ever |
04:35:29 | skrylar | my only question is why do the toys only exist in whitepapers :( |
04:36:01 | skrylar | is it because IBM proved most developers are hacks? |
04:36:13 | zacharycarter | that'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:14 | zacharycarter | besides comanche gold etc |
04:36:15 | zacharycarter | and delta force |
04:36:39 | skrylar | https://www.evl.uic.edu/vchand2/thesis/papers/kizamu.pdf |
04:37:10 | skrylar | well, one trouble with voxels is that getting them to models is annoying |
04:37:23 | skrylar | but now with Instant Meshes, perhaps not so much anymore |
04:38:15 | skrylar | theres 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:42 | zacharycarter | I think there's too much tooling / practice around polygonal modeling |
04:38:46 | skrylar | Art doesn't need to be suffering these days, we just need more brilliant people implementing this shit |
04:38:59 | zacharycarter | like it'd be a huge industry disruption to abandon all of that and move towards a voxel based solution |
04:39:28 | skrylar | some of it is that there is little oxygen in the room |
04:39:39 | skrylar | (or in more known business terms, the 3d modeling space is a very red ocean) |
04:39:58 | skrylar | indies just get crushed under the never-ending use of maya/max |
04:40:04 | zacharycarter | yeah |
04:40:15 | zacharycarter | well - I think if you can wrap your head around how to leverage it - https://www.sidefx.com/ is the winner |
04:40:34 | zacharycarter | https://www.sidefx.com/products/houdini-core/ is amazing |
04:40:43 | skrylar | I have heard houdini is a great animator. I don't know why people think that |
04:40:49 | skrylar | (i refuse to use dongled or activated software) |
04:41:06 | zacharycarter | it's more than that |
04:41:11 | zacharycarter | check this out |
04:41:51 | zacharycarter | https://vimeo.com/150180595 |
04:42:47 | zacharycarter | it's all node / parameter based and then you construct nodes to procedurally generate scenes |
04:42:56 | skrylar | ah. procedural stuff is fun |
04:43:04 | skrylar | i've wanted a clone of substance designer for a while |
04:43:22 | zacharycarter | you wouldn't use it to base model a human for instance |
04:43:25 | skrylar | i think it can be done by leveraging graphicsmagic probably |
04:43:40 | zacharycarter | I can ship you a copy of substance probably - I have it pirated I'm pretty sure |
04:43:49 | skrylar | i have a license |
04:43:51 | zacharycarter | I also have a legit copy - but it's over my head to use it |
04:44:09 | skrylar | i have a now outdated filterforge and designer/painter |
04:44:13 | zacharycarter | I get to the point where I've made something in modo / maya / 3ds max |
04:44:15 | zacharycarter | then I fall apart |
04:44:29 | zacharycarter | yeah - their licensing is bullshit |
04:44:36 | zacharycarter | I also have a copy of zbrush8 |
04:44:41 | zacharycarter | but again - I suck at art |
04:44:50 | skrylar | zbrush can go to hell (web activation) |
04:45:00 | zacharycarter | omg I'd love to be good at zbrush |
04:45:00 | skrylar | i tried it and having to screw with polygons was lame |
04:45:03 | zacharycarter | such a sexy app |
04:45:07 | skrylar | 3dcoat \o/ |
04:45:19 | zacharycarter | you don't have to mess with polys in zbrush! |
04:45:34 | skrylar | you actually do, you can screw up the polys if you pinch too much |
04:45:55 | zacharycarter | well - they have a mode where you don't mess with polys at all |
04:46:33 | skrylar | i 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:02 | zacharycarter | I've never done voxel sculpting with 3dcoat - I was just using 3dcoat to retopo stuff |
04:47:05 | skrylar | voxel sculpting still has resolution tuning; ASDF's automatically adjust resolution to fit |
04:47:16 | zacharycarter | I didn't even realize it could do that |
04:47:23 | skrylar | thats sort of its big thing |
04:47:34 | zacharycarter | well - i think that's what zbrush tries to do |
04:47:36 | skrylar | my best work has come from 3d coat sculpting |
04:47:44 | zacharycarter | it like adds / subtracdts polys in an abstract fashion |
04:47:59 | zacharycarter | hrm - I need to play around more with 3d coat I guess |
04:48:21 | zacharycarter | I'm guessing your best work looks better than mine haha |
04:48:21 | skrylar | i have some udemy classes on it |
04:48:23 | zacharycarter | I'll link you to my latest model that I failed to do anything with |
04:48:58 | skrylar | https://farm7.static.flickr.com/6128/5932760077_e580e26c24_b.jpg |
04:49:00 | zacharycarter | https://lh3.googleusercontent.com/-5KsyAhd4-j8/WfNUe9lC71I/AAAAAAAAMFU/_XMb7RFo5Ys9HJvqyz9CNJ4kSfQLYxkKgCL0BGAYYCw/h720/RenderFinal.png |
04:49:33 | zacharycarter | once I made that gun though - I couldn't do shit with it |
04:49:55 | zacharycarter | like I could follow a tutorial on UVing it and then when I went to make normal maps everything would turn out shit |
04:50:10 | zacharycarter | spent about two weeks trying to figure out how to make it usable and then gave up :/ |
04:50:23 | skrylar | normal maps are not so hard but its one of those things people don't like to give straight answers on |
04:50:49 | zacharycarter | even the fuckers at modo couldn't help me |
04:50:52 | * | yglukhov[i] joined #nim |
04:50:52 | zacharycarter | they were like - well try blowing up the model and uving everything seperately etc |
04:51:00 | skrylar | 3d coat will do your normals for you from a voxel |
04:51:06 | zacharycarter | I tried generating UV maps in substance, modo, maya etc |
04:51:14 | zacharycarter | meh - maybe I just need to try that then |
04:51:18 | skrylar | if 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:24 | zacharycarter | I literally spent like 3 weeks on that model |
04:51:34 | zacharycarter | and was so pissed when I couldn't do anything with it |
04:51:34 | skrylar | yea, sounds like you just hit a knowledge failure |
04:51:37 | skrylar | am familiar with those |
04:51:47 | skrylar | often times if something seems ridiculously hard its because a fundamental is missing |
04:51:57 | zacharycarter | yeah |
04:52:14 | zacharycarter | well - I figured I shouldn't have tried to make a gd rail gun as my first big modeling project |
04:52:20 | zacharycarter | I should have probably made like a bolt or something |
04:52:24 | skrylar | another thing you can do, at least nowadays, is just let the sculpter auto-mesh for you |
04:52:34 | skrylar | you can take the stupidly high-res out and flop it in to instantmeshes |
04:52:39 | zacharycarter | but 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:02 | skrylar | normal mapping is automatic |
04:53:07 | skrylar | UV mapping not so much |
04:53:17 | * | Jesin joined #nim |
04:53:22 | zacharycarter | ugh - yeah I need to explore new tooling then - I struggled way too hard / long on that one |
04:53:44 | zacharycarter | I liked the model - I mean it looks like a generic ass sci fi weapon - but I thought it looked decent |
04:53:47 | zacharycarter | yeah UV mapping was no problem |
04:53:55 | skrylar | 3DC and blender have least-squares-conformal-mapping, which means you just set the seams and it lays it out for you |
04:54:03 | zacharycarter | generating the normal / bump / etc maps was the bitch |
04:54:05 | skrylar | wings also has an auto uv mapper based on painting zones |
04:54:31 | skrylar | working with UVs is one of those things tht still happens but should not be happening, because ptex and projection painting obsolete it |
04:54:32 | zacharycarter | yeah - 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:51 | skrylar | ptex was made by disney for films |
04:54:57 | zacharycarter | maya sucks ass on OSX - just breaks randomly |
04:55:08 | zacharycarter | I've never even heard of ptex before you brought it up tonight |
04:55:08 | skrylar | each face gets its own texture, can have its own resolution level, and knows its neighbors |
04:55:10 | * | xylef joined #nim |
04:55:17 | skrylar | 3d coat also supports ptex and projection painting :) |
04:55:46 | skrylar | so 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:01 | zacharycarter | does it bake out to OBJ / FBX etc? |
04:56:09 | zacharycarter | or do you need a ptex parser? |
04:56:17 | * | Jesin joined #nim |
04:56:23 | skrylar | it outputs native ptex files i think |
04:56:48 | skrylar | there 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:17 | zacharycarter | https://polycount.com/discussion/123319/why-is-ptex-not-used-in-games |
04:57:17 | skrylar | zbrush 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:27 | zacharycarter | just reading through that |
04:57:37 | zacharycarter | ah okay |
04:58:24 | * | Jesin quit (Max SendQ exceeded) |
04:58:39 | zacharycarter | ` I regularly bake down stuff from HighP meshes with Ptex to Lowpoly UV's in Mudbox` |
04:58:41 | zacharycarter | sounds like what I should be doing |
04:58:57 | * | Jesin joined #nim |
04:59:18 | zacharycarter | lol last comment |
04:59:20 | zacharycarter | this will get you going |
04:59:28 | zacharycarter | ``` |
04:59:28 | zacharycarter | 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:29 | zacharycarter | ``` |
04:59:48 | zacharycarter | I remember sometime last year you were looking into those haha |
05:00:10 | skrylar | yes, sean berret (of stb_* and nothings.org?) has a talk on them |
05:00:41 | zacharycarter | I've actually read / encountered a lot of hate for that guy |
05:01:21 | zacharycarter | people saying his libs have a lot of issues, espectially stb img |
05:01:31 | skrylar | https://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:48 | skrylar | its AMD not nvidia, my bad |
05:02:04 | * | Jesin joined #nim |
05:02:45 | skrylar | they 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:21 | skrylar | now we just need someone to use libmypaint, run the brushes through a 3d projection and paint on to model layers :) |
05:03:45 | zacharycarter | :) |
05:03:48 | zacharycarter | https://github.com/RandyGaul/cute_headers - I like this guy |
05:04:14 | zacharycarter | over sean barnett or whatever his name is |
05:04:17 | skrylar | stb 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:58 | skrylar | raylib uses them, i generally don't |
05:05:16 | skrylar | stb_image is cute, but under the circumstances give me flif and webp |
05:06:18 | skrylar | we'd need a gui, but i wonder how many people would use a pipeline tool from nim :hrm: |
05:06:23 | zacharycarter | zengine is basically just a giant port of raylib to Nim |
05:06:25 | skrylar | monogame still uses theirs for importing content |
05:06:45 | zacharycarter | I think I added skeletal animation and a few font rendering techniques like SDF |
05:06:48 | * | Jesin quit (Max SendQ exceeded) |
05:06:53 | zacharycarter | but other than that it is literally raylib in Nim lmao |
05:06:54 | skrylar | how did you get sdf to work |
05:07:03 | skrylar | i've never gotten sdf fonts to work |
05:07:07 | zacharycarter | SDF is just shaders |
05:07:17 | * | Jesin joined #nim |
05:07:40 | skrylar | i 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:41 | zacharycarter | let me try to remember - I know if it's not in zengine I have code for it in frag |
05:08:14 | skrylar | also 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:48 | skrylar | ericcson is mandatory for GLES3 |
05:09:05 | * | Jesin joined #nim |
05:09:10 | zacharycarter | I'm pretty sure I followed this guide - https://github.com/libgdx/libgdx/wiki/Distance-field-fonts |
05:11:01 | skrylar | i'm not sure i'm happy with what passes for a game engine |
05:11:07 | skrylar | i wish they were just called rendering toolkits |
05:11:12 | zacharycarter | I 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:27 | skrylar | when 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:46 | skrylar | but i see game engines that don't even have UIs |
05:11:49 | zacharycarter | at the time I was really interested in font rendering for rougelikes and didn't quite understand how bitmap fonts worked |
05:11:57 | zacharycarter | so I was exploring / implemented SDF rendering until I realized I could just use a bitmap font |
05:12:06 | skrylar | sdfs are bitmap fonts ;p |
05:12:06 | * | Jesin joined #nim |
05:12:17 | zacharycarter | well just with shaders packed on top |
05:12:23 | zacharycarter | what I mean is like |
05:12:31 | zacharycarter | I wasn't rendering the font from a single bitmap image |
05:12:42 | zacharycarter | and using coordinates to specify which characgter to render |
05:12:43 | skrylar | oh. atlasses |
05:12:50 | zacharycarter | yeah that's what I mean |
05:13:10 | zacharycarter | so I went with SDF at first - and I was like - how the fuck do rougelikes do this with just a single image |
05:13:17 | skrylar | depending on what GL you have, you can get font rendering pretty compact |
05:13:21 | zacharycarter | and then when I figured that out - I abandoned SDF |
05:13:42 | zacharycarter | well - 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:33 | zacharycarter | I'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:53 | zacharycarter | and I think whatever rendering lib I write in the future - I'll be using BGFX |
05:15:09 | zacharycarter | lol our architect at work doesn't know how to do me /me |
05:15:31 | zacharycarter | so he does this thing in slack where he like bolds his emotions - like he'll do nods constantly |
05:15:46 | zacharycarter | with two asterisks so it just shows up as bold |
05:16:04 | skrylar | discord actually just wraps /me messages with markdown _'s |
05:16:13 | zacharycarter | and 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:22 | zacharycarter | well the best part is |
05:16:26 | zacharycarter | I found his old personal blog |
05:16:54 | * | Jesin quit (Max SendQ exceeded) |
05:17:16 | zacharycarter | he 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:58 | zacharycarter | and 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:34 | skrylar | reading that polycount post |
05:18:51 | skrylar | its 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:17 | skrylar | blender 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:32 | zacharycarter | yeah - modo made UVing a breeze for the most part |
05:19:42 | skrylar | i 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:56 | zacharycarter | took him till 2007 to figure this shit out |
05:22:17 | skrylar | i don't understand some of these posts |
05:22:27 | skrylar | "separating uv islands adds more vertices" what |
05:22:31 | zacharycarter | I'm pretty sure I was playing doom in 94 when I was 9 years old and doom was out |
05:22:53 | skrylar | UVs are not subject to primitive types, only faces are |
05:23:14 | zacharycarter | yeah uvs are just groupings of existing topologies right? |
05:23:24 | skrylar | the 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:26 | zacharycarter | like you can't create a new grouping of vertices via UVs |
05:23:35 | skrylar | UVs are an *attribute* |
05:23:39 | skrylar | of a vertex |
05:23:58 | skrylar | they would never increase the rendering cost |
05:24:10 | skrylar | unless you use a separate MATERIAL, which is because you would have to swap shaders |
05:24:55 | skrylar | i think these people just have stockholm syndrome |
05:25:14 | skrylar | there 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:55 | zacharycarter | it'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:59 | skrylar | it is weird yes. what we show artists is not what we shhow hardware |
05:26:59 | zacharycarter | well - artists in general I've found usually just follow a workflow they know, whether it makes sense technically or not |
05:27:06 | skrylar | artists just see faces and materials and we see render calls |
05:27:35 | zacharycarter | I'm like half way in between there :P |
05:27:47 | skrylar | technical artists are poor sods who see too much |
05:28:13 | zacharycarter | not 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:59 | skrylar | actually unwrapping is not so bad with LCSM but i hate seams |
05:29:01 | zacharycarter | I 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:34 | zacharycarter | I'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:42 | skrylar | I wonder how pronounced seams are with careful re-baking |
05:29:47 | zacharycarter | doing computer science backwards is hard :/ |
05:29:49 | skrylar | Or if they are inevitable |
05:29:50 | * | odc quit (Ping timeout: 276 seconds) |
05:29:52 | * | odc_ is now known as odc |
05:30:14 | zacharycarter | in my experience they're not avoidable |
05:30:17 | zacharycarter | it's just hiding them correctly |
05:30:27 | zacharycarter | but 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:47 | zacharycarter | like you have to stick that ugly seam somewhere |
05:30:59 | skrylar | it is possible to avoid a seam |
05:31:04 | skrylar | it 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:26 | skrylar | seams are the result of two edges having dissimilar connectivity |
05:31:26 | zacharycarter | but 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:27 | zacharycarter | well yeah - I mean you can retopo away |
05:31:28 | zacharycarter | but eventually you're going to end up with one |
05:31:51 | skrylar | like, ptex is a ton of different interlocking textures == no seams |
05:32:16 | zacharycarter | okay so I see where you're going - it should then be possible to figure out that logically and fix it |
05:32:36 | skrylar | so 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:57 | zacharycarter | if two edges are connected in a dissimilar fashion - it should be possible to figure out how to remedy that computationally |
05:33:04 | zacharycarter | or that too |
05:33:08 | * | euantor is now known as Guest51560 |
05:33:33 | zacharycarter | yeah - I don't know - whenever I've UV'd models I've done it manually |
05:33:39 | zacharycarter | and it's always a feeling out process |
05:33:49 | * | avsej quit (Ping timeout: 260 seconds) |
05:34:00 | zacharycarter | like you UV it one way and figure out that you could do it better a different way |
05:34:11 | zacharycarter | but yeah - it makes sense all that could potentially be done algorithmically |
05:34:28 | skrylar | well 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:00 | skrylar | there might be minor artifacts from re-projection (i haven't tried) but you could smooth the edges with interpolation |
05:35:09 | skrylar | but this requires the uv editor and paint program be intertwined |
05:35:31 | * | m712 joined #nim |
05:36:02 | zacharycarter | hrm 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:25 | zacharycarter | like I'd hide portions of the geometry, UV them, get to the point where I had everything UVd |
05:36:33 | zacharycarter | bring it into another program like substance and end up with terrible maps |
05:36:37 | skrylar | i guess you actually can just export the layer to png/tiff and trigger krita |
05:36:48 | skrylar | 3d coat offers this |
05:36:53 | zacharycarter | but if that was all done in realtime so I could see the results of the maps being generated based on the UVs |
05:37:04 | zacharycarter | and the VUs autocorrecting manual mistakes |
05:37:12 | skrylar | well the thing here is: the UV you paint does not need be the UV the engine uses |
05:37:13 | zacharycarter | that'd be amazing |
05:37:27 | skrylar | as the mudbox user said you can bake ptex to an arbitrary UV |
05:37:58 | zacharycarter | how does the latter come into fruition? |
05:38:34 | skrylar | you 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:58 | skrylar | submit 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:27 | zacharycarter | okay 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:51 | zacharycarter | apply to status dude |
05:42:00 | benjikun | skrylar: sounds like the latter to me :) |
05:42:10 | zacharycarter | I have no idea what your ideal work / living situation is - but there's already solid Nim developers working there |
05:42:44 | zacharycarter | I 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:54 | zacharycarter | I don't think you'd have any issues regarding that |
05:44:15 | zacharycarter | skrylar: if you want more info - PM me and I can get you in touch with their people / recruiters / other Nimmers working there |
05:45:06 | zacharycarter | they're porting / optimizing the ethereum implementation from Golang to Nim and doing other cool things surrouding crypto |
05:45:17 | zacharycarter | all open source too |
05:47:32 | skrylar | tip: i also have no formal CS education |
05:47:53 | zacharycarter | well now you're just making me look bad :P |
05:48:05 | zacharycarter | I'm a history major - does that help my cause at all? :P |
05:48:19 | skrylar | i didn't even go to high school ._. |
05:48:28 | zacharycarter | god damnit lol |
05:48:34 | * | skrylar GED :f |
05:49:01 | skrylar | hey at least you aren't doomed to repeat your mistakes. |
05:49:08 | zacharycarter | lololol |
05:49:11 | skrylar | like taking history classes |
05:49:32 | zacharycarter | history repeats itself |
05:49:45 | skrylar | it has a tendency to do that. and people guard it so loosely. |
05:50:02 | skrylar | had a conversation earlier about how police get away with little, journalists can interview mobsters, and archivists interview everyone. |
05:50:20 | skrylar | the information is allowed inversely proportionate to perceived power, because people don't believe shaping the history record is a power |
05:51:01 | zacharycarter | you need look no further than the current president of the US to find evidence to that fact |
05:51:42 | skrylar | it's not like ron paul was an option |
05:52:02 | zacharycarter | shaping history / small hands |
05:52:23 | zacharycarter | not with that haircut |
05:52:47 | zacharycarter | oh I was thinking about his son |
05:53:02 | skrylar | people really were being unfair to the guy, although he has since earned some of it |
05:54:41 | skrylar | having 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:49 | zacharycarter | at least they're not deciding on the future of voxels vs polys |
05:55:54 | zacharycarter | well - I don't even know what how you categorize the US's form of government |
05:56:09 | skrylar | basically (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:28 | skrylar | Think and Grow Rich talks about how successful man generally requiresa small council of good thinkers |
05:56:50 | skrylar | So a small republic of apt persons are needed to run a community/project |
05:56:51 | zacharycarter | you 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:10 | skrylar | they did tho. east indie trading company? |
05:57:20 | benjikun | zacharycarter: Founding fathers experienced similar problems, just less amplified |
05:57:21 | skrylar | the orignial model of the US had safeguards, we just ignore them |
05:57:52 | benjikun | a lot of the problems were philosophized by them, even |
05:57:58 | skrylar | but i think its amusing to investigate the current backlash against bdfl's even though its the only model that works |
05:59:11 | zacharycarter | apt points for sure - I guess my only argument is it's a different world |
05:59:21 | zacharycarter | but I agree - you need someone running the show who knows what they're doing |
05:59:31 | zacharycarter | or a small set of persons |
05:59:38 | skrylar | well if you believe in Hobbs, people gravitate towards leaders |
05:59:43 | * | cspar joined #nim |
05:59:44 | zacharycarter | look at how great Nim is |
05:59:56 | zacharycarter | I though it was all about people being naturally good vs evil |
05:59:59 | zacharycarter | hockes lobbes and all that |
06:00:06 | skrylar | thomas hobbes? |
06:00:13 | zacharycarter | hobbs |
06:00:38 | zacharycarter | gd dyslexia |
06:00:41 | skrylar | people in general are crap |
06:00:53 | zacharycarter | yes I meant hobbes and lockes |
06:01:11 | benjikun | yeah 99% of everyone is incapable of making critical decisions |
06:01:13 | zacharycarter | but you may have meant something totally different when you said Hobbs haha |
06:01:17 | benjikun | it's just genetic |
06:01:39 | skrylar | well 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:08 | zacharycarter | dude - 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:33 | zacharycarter | the 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:08 | benjikun | apologizing for that isn't necessarily bad |
06:03:13 | skrylar | don't apologize for anything that you don't have to, but be ready to repent when you screw up :) |
06:03:27 | skrylar | repentance is an interesting if misunderstood concept |
06:03:38 | zacharycarter | when 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:54 | benjikun | lol |
06:04:00 | zacharycarter | apologizing 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:04 | skrylar | pair.. programming... |
06:04:07 | * | skrylar hands zacharycarter a pear. |
06:04:58 | * | dvn joined #nim |
06:05:05 | skrylar | https://cdn.discordapp.com/attachments/278558544146464778/427924853752987662/spode.jpg |
06:05:32 | zacharycarter | lol that is a cute ass spider |
06:06:18 | zacharycarter | also your couch looks comfy af |
06:06:28 | benjikun | there is a person I remember from high school named zachary carter |
06:06:44 | zacharycarter | did you go to Oakton HS in Virginia? |
06:06:49 | benjikun | nope |
06:06:51 | benjikun | North Carolina |
06:07:30 | zacharycarter | well - at least you live in a nice state :) |
06:07:35 | Tanger | zacharycarter, So, sounds like pair programming minus the "pair" part. Have you considered replacing him with a rubber duck? |
06:07:37 | zacharycarter | my parents are retiring down there |
06:08:45 | zacharycarter | Tanger: 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:02 | zacharycarter | I'm too busy making sure the entire rest of our stack is functioning to worry about how our react VDOM is rendering |
06:09:30 | benjikun | w e b d e s i g n e r s |
06:09:33 | Tanger | Hey, I have people like that here too! The JS grunts |
06:10:00 | skrylar | unit tests are an important part of making sure you didn't feed the code spoders |
06:10:02 | Tanger | JS isn't my cup of tea. But they always have free time to take on jobs |
06:10:08 | benjikun | I 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:13 | zacharycarter | we 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:37 | skrylar | those are called customers, zacharycarter #leanstartup |
06:10:40 | zacharycarter | unit tests are great - except when like 99% of them are testing stupid ass javascript / reactd code |
06:10:46 | Tanger | UAT === Prod, amirite? |
06:11:06 | zacharycarter | I wish |
06:11:12 | zacharycarter | oh and we have to interview potential hires too - but that's volunteer work |
06:11:26 | Tanger | Volunteer work? 0_o |
06:11:38 | Tanger | That's dumb |
06:11:45 | zacharycarter | dude it's a show - they say you get to help interview candidates for your team! |
06:11:47 | zacharycarter | except we |
06:12:04 | zacharycarter | '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:04 | Tanger | Nobody volunteers due to work load, nobody gets hired to take work load, hence nobody can volunteer, etc, etc |
06:12:22 | zacharycarter | there was a few months where 25% of my time at work I was interviewing / involved in the hiring process of candidates |
06:12:29 | zacharycarter | as a developer |
06:12:37 | skrylar | just do what game developers do and never hire anyone |
06:12:41 | Tanger | Sounds like a good waste of your time |
06:12:42 | skrylar | lol |
06:12:44 | Tanger | Haha |
06:12:50 | zacharycarter | yeah so I just stopped doing it and now there's only like 1-2 people that volunteer and no one gets interviewed |
06:13:33 | zacharycarter | I'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:51 | Tanger | Seems to have worked for people so far |
06:13:57 | zacharycarter | I'll hop into photoshop / bryce / 3dsmax on occasion |
06:14:07 | zacharycarter | cook up some cool asss fake screenshots |
06:14:08 | skrylar | zacharycarter, the tim schafer package requires a slight amount of pre-existing rep to start that plan with |
06:14:12 | Tanger | Progress update: I polished off 2 cartons yesterday, for inspiration |
06:14:22 | zacharycarter | yeah exactly |
06:14:35 | zacharycarter | I'm pretty sure I could even replace polishing off cartoons with jerking off |
06:14:38 | skrylar | i wouldn't nkow what to do with the money |
06:14:39 | zacharycarter | and I could still get away with it |
06:14:49 | skrylar | like, a guy actually is posting things to my github and i'm like o__o |
06:15:02 | skrylar | i know a coder monkey but he's.. eugh. |
06:15:02 | zacharycarter | I had this amazing JO session yesterday - I came up with so many new and great ideas - this will be AMAZING! |
06:15:12 | zacharycarter | alright guys - give me $$$ |
06:15:39 | skrylar | just attempt to make something so glorious that you fail spectacularly |
06:15:59 | Tanger | No Man's Sea? |
06:16:02 | Tanger | No relation |
06:16:11 | zacharycarter | lol |
06:16:18 | skrylar | sunless seas in full 3d |
06:16:26 | zacharycarter | I've tried to do this with Nim |
06:16:47 | skrylar | i dunno. i tried reading how to make a "casual RTS" |
06:16:50 | Tanger | How are Nim's game engines like? |
06:16:54 | skrylar | turns out its called halo wars 1 |
06:16:55 | zacharycarter | but then someone asks me about aws / kubernetes / some other bullshit enterprise tech and I have no answer |
06:17:56 | zacharycarter | when Nim gets a propper game engine - I will support the hell out of it / buy it / build stupid games with it |
06:18:27 | skrylar | did 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:37 | zacharycarter | lol |
06:19:05 | zacharycarter | I spent a good two weeks fucking with OpenGL / Shaders to figure out how to make a unit circle |
06:19:15 | zacharycarter | and I didn't even come close to figuring out how to merge them |
06:19:41 | skrylar | paint them on a separate layer and run a convolution pass to find the edges? |
06:20:40 | skrylar | i 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:47 | skrylar | thats probably cheaper |
06:20:50 | zacharycarter | although - https://github.com/a-nikolaev/curseofwar |
06:21:14 | zacharycarter | yeah - I just didn't know how the stencil buffer worked |
06:21:37 | zacharycarter | I did have some awesome 2d isometric rendering going on in my nim game engine though |
06:22:16 | skrylar | i saw halo wars 1 on youtube and did some reading; it' eeh |
06:22:24 | skrylar | well simple rts games tend to just be spam to win |
06:22:59 | zacharycarter | Araq's dream is to have a RTS written in Nim |
06:23:08 | zacharycarter | the problem with RTS games is - you need tons of graphics |
06:23:21 | zacharycarter | a RPG using FLARE open source graphics would be much easier to write in Nim |
06:23:39 | zacharycarter | so that's probably the direction I'm going to go in with my next game / engine project |
06:24:04 | zacharycarter | I spent a good month or two looking for open source RTS capable graphics to make a RTS with |
06:24:24 | skrylar | there was a set of those that were old amiga pixel art |
06:24:26 | zacharycarter | you can't use anything you buy on the unity / UE4 stores in open source projects |
06:24:40 | zacharycarter | open game art is a shit show when it comes to open source RTS graphics |
06:25:39 | zacharycarter | http://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:00 | skrylar | graphics are not insurmountable |
06:26:12 | skrylar | people play dominions and those are largely static sprites |
06:27:46 | zacharycarter | yeah but overcoming that takes creativity |
06:27:50 | zacharycarter | which I am also horrible at |
06:28:18 | zacharycarter | https://britzl.github.io/Warbattles-RTS/ |
06:28:23 | zacharycarter | that was the other one |
06:28:33 | skrylar | constraining the scale is an issue; how big are the maps, squads (CoH/DoW) or single units (Spring) |
06:28:37 | zacharycarter | and when I showed those graphics to Araq I think he puked |
06:29:45 | zacharycarter | I don't really posess the creativity genes for making an awesome new game concept or killer graphics |
06:30:04 | FromGitter | <survivorm> Didn't he played dune? |
06:30:11 | FromGitter | <survivorm> long-long ago ^) |
06:30:16 | zacharycarter | I'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:24 | zacharycarter | so cobbling together a game framework that can run a stupid small RTS is feasible |
06:30:40 | skrylar | i wonder how obedient raylib is |
06:30:54 | skrylar | like if you can just shove its rendering bits in pre-existing opengl contexts |
06:30:55 | zacharycarter | don't use raylib |
06:31:00 | zacharycarter | that dude has no idea wtf he's doing |
06:31:14 | zacharycarter | myself / others have found major flaws in his OpenGL calls |
06:31:15 | skrylar | but i dont wanna bind allegro again |
06:31:22 | zacharycarter | like he goes against the OpenGL spec in several ways |
06:31:27 | zacharycarter | use BGFX |
06:31:36 | skrylar | bgfx doesn't let me shit sprite batches |
06:31:38 | skrylar | allegro does |
06:31:41 | zacharycarter | and use the renderer I will eventually write |
06:31:50 | zacharycarter | I can give you a sprite batch for bgfx |
06:31:55 | zacharycarter | I've written one before |
06:32:40 | skrylar | there are actually a ton of design troubles with strategy games |
06:32:47 | zacharycarter | there 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:53 | zacharycarter | but CSMFL is your best bet |
06:33:11 | zacharycarter | or godot |
06:33:34 | zacharycarter | first thing Nim needs is a cross platform windowing library |
06:33:59 | zacharycarter | but 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:18 | zacharycarter | or you can just take BGFX and combine it with CSFML and just use the CSFML windowing code and ditch everything else |
06:34:23 | zacharycarter | BGFX just really cares about the render loop |
06:34:47 | skrylar | well, design issues are more daunting than ther est. the other problems are 'solved' although they require yak shaving and typing |
06:35:05 | zacharycarter | but 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:24 | skrylar | i remember trying to play Dawn of War 2 with the elite mod community, and it was a very unwelcoming experience |
06:35:44 | skrylar | nobody would help you out, and the game is full of "if this race v. that race, use this build or lose hard." |
06:36:13 | zacharycarter | sounds like a bad MMO |
06:36:45 | zacharycarter | the thing about Nim and SMFL / SDL2 / etc... is this |
06:37:09 | zacharycarter | Nim handles GC / threading in a very unique manner vs how these libraries expect it to be handled |
06:37:27 | zacharycarter | so if you bind yourself to one of these windowing libraries that takes control of threading for you |
06:38:01 | zacharycarter | you'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:34 | skrylar | there's also "fun" problems like stream economies vs. cash economies ;p |
06:38:38 | zacharycarter | what I think is the most logical approach is to take all the window / system code out of a lib like SMFL |
06:38:57 | zacharycarter | and then use that to write your own lib / framework with |
06:39:14 | zacharycarter | until Nim gets a stable game "engine" "framework" "library" whatever |
06:39:41 | zacharycarter | because at this point - beyond myself and Krux02 all people have done is written SDL games / SMFL games with Nim |
06:40:06 | zacharycarter | there's zero exploration into a 3d game engine with a propper editor, etc... |
06:40:31 | zacharycarter | if we can get to that point - we'll have something D / Rust doesn't have |
06:40:57 | zacharycarter | there's already plenty of example code demonstrating how to do it in C/C++ with libs like ImgUI |
06:41:09 | zacharycarter | we have Nuklear bindings - we should be able to do the exact same thing with Nim |
06:41:45 | zacharycarter | the 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:42 | zacharycarter | so 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:52 | zacharycarter | yes - 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:12 | skrylar | those are unfascinating topics |
06:43:15 | zacharycarter | we 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:27 | zacharycarter | meh - I'll do them |
06:43:31 | skrylar | i really can't do anything better than physfs |
06:44:21 | skrylar | rolling your own glfw is not really hard, it's just tedious |
06:44:24 | zacharycarter | I'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:33 | zacharycarter | we don't need to roll a glfw |
06:44:47 | skrylar | "windowing library" thats exactly what glfw IS |
06:45:05 | zacharycarter | we can just steal the window / sys code from SFML which is already written in C |
06:45:15 | zacharycarter | the big thing is the renderer, the VFS and resource loading |
06:45:32 | zacharycarter | yeah but keep in mind glfw has no mobile support |
06:45:38 | zacharycarter | SFML does - so does SDL2 |
06:46:25 | zacharycarter | SFML does what SDL2 does minimally - SDL2 has a lot of other crap added on top through extensions |
06:46:51 | zacharycarter | but at the bare minimum SFML provides windowing, input, system access and basically everything you need to build a game |
06:47:02 | zacharycarter | and you don't need to use their renderer / graphics stuff |
06:48:49 | FromGitter | <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:16 | FromGitter | <tim-st> just thought about if overloading would work |
06:49:52 | * | PMunch joined #nim |
06:51:06 | zacharycarter | tim-st: add a comment to the issue - no harm in suggesting an idea |
06:51:27 | zacharycarter | I don't know if any of us currently chatting are that familiar with the issue you linked to |
06:51:58 | FromGitter | <tim-st> dont want to destroy it^^ |
06:53:06 | zacharycarter | Don'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:17 | FromGitter | <tim-st> ok |
06:53:34 | zacharycarter | IMO - if you have an idea or a suggestion on an issue in the github repo - post away |
06:54:14 | zacharycarter | the 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:42 | FromGitter | <tim-st> ok, then I dont post it :D |
06:54:50 | zacharycarter | I think anyone contributing to Nim in any sense of the word is valued by anyone that cares about the language |
06:55:43 | zacharycarter | hahaha - don't be afraid! people might bite but it's just internet bytes! |
06:56:15 | FromGitter | <tim-st> just read it again maybe it's already in the text and I didnt see |
06:57:25 | zacharycarter | it is a long ass RFC |
06:57:39 | zacharycarter | I 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:13 | zacharycarter | and I can now stop pretending I know why python can catch these exceptions and treat them non fatally while Nim cant! |
06:59:00 | skrylar | doesn't relying on enums for errors kind of brick user defined errors |
06:59:07 | FromGitter | <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:24 | zacharycarter | skrylar: 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:59 | FromGitter | <rayman22201> Thats |
07:06:21 | skrylar | using one big enum is normal for embedded runtimes, but they usually add custom exceptions to said enum |
07:06:48 | FromGitter | <rayman22201> Lol. That's the rfc I was talking about when I was online earlier |
07:07:34 | FromGitter | <rayman22201> @tim-st the problem with |
07:08:02 | FromGitter | <rayman22201> Ugh... Mobile hitter client fail |
07:08:11 | FromGitter | <tim-st> ^^ |
07:08:18 | zacharycarter | yeah - I had no context haha but it all makes sense now :P |
07:08:37 | zacharycarter | supervisor concept sounds crazy |
07:08:40 | FromGitter | <rayman22201> The problem with raise("error") is that it has to allocate that string somewhere |
07:09:06 | FromGitter | <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:19 | FromGitter | <tim-st> and const strings doesnt need to be allocated? |
07:09:23 | zacharycarter | does not look like something I want to write |
07:09:31 | FromGitter | <rayman22201> @skrylar Good question about user defined exceptions though |
07:09:56 | zacharycarter | consts are compile time constants right? |
07:10:12 | FromGitter | <tim-st> Isnt that the "exception hierchachy"? if so Araq said yesterday it isnt supported |
07:11:28 | FromGitter | <rayman22201> Const string would be OK. |
07:13:14 | * | roboxnik joined #nim |
07:15:51 | FromGitter | <rayman22201> @zacharycarter yeah. Const == compile time constant |
07:20:05 | skrylar | i think what i once read is that they pre-allocate the out of memory error |
07:20:15 | skrylar | so 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:38 | FromGitter | <tim-st> ok, that's good |
07:25:01 | skrylar | well, i don't know that araq is doing that |
07:25:05 | skrylar | but some embeddeds do |
07:28:18 | FromGitter | <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:26 | skrylar | they removed that clause from the eula |
07:30:09 | skrylar | I don't have much to say wrt. political or religious developers. one really can't separate the two |
07:30:11 | Tanger | Whoa, so they are |
07:30:18 | FromGitter | <rayman22201> Good to know. That was a big controversy if I remember |
07:30:26 | Tanger | "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:35 | Tanger | Wizardry and witchcraft? |
07:30:46 | skrylar | the guy who wrote it allegedly had a big problem with sex addiction and depression |
07:31:23 | FromGitter | <rayman22201> I'm not judging |
07:31:24 | skrylar | we aren't all machiavelians :p |
07:31:42 | skrylar | https://openpsychometrics.org/tests/MACH-IV/ |
07:31:43 | FromGitter | <rayman22201> Lol |
07:32:42 | skrylar | i 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:49 | skrylar | the more you hate humanity the more you pay :e |
07:36:35 | FromGitter | <rayman22201> Hahaha |
07:37:54 | * | jjido quit (Ping timeout: 256 seconds) |
07:41:46 | skrylar | kind of want a nim version of loomio |
07:41:49 | Araq | skrylar: if we do that. it means every program starts with a heap allocation in order to support throwing OOM. |
07:42:16 | skrylar | Araq, you can't just bullshit the exception from the constant section? |
07:42:25 | Araq | I know I wrote code to do just that but tbh I don't know how it's done today |
07:42:47 | Araq | 'ref' is never from a constant section, the GC assumes it can collect it. |
07:43:25 | skrylar | edge cases are suffering |
07:48:43 | * | Vladar joined #nim |
07:53:12 | * | gangstacat quit (Ping timeout: 256 seconds) |
07:57:21 | FromGitter | <tim-st> Araq: does it mean something like `raise ValueError(stringVar)` doesnt work? |
07:58:24 | FromGitter | <Bennyelg> hey, anyone know how I define path to nim only on the user workspace on vscode ? |
07:58:38 | FromGitter | <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:43 | Araq | tim-st: that doesn't work today either and much code still uses 'raise newException(ValueError, "foo")' which will continue to compile |
08:19:25 | FromGitter | <tim-st> yes, I meant could hat syntax be possible with the new approach? |
08:22:46 | FromGitter | <Araq> nah, it's not part of this proposal. |
08:22:59 | FromGitter | <Araq> in fact, no syntax change is proposed. |
08:23:20 | FromGitter | <tim-st> this wouldnt be a change or? |
08:24:00 | FromGitter | <Araq> if ValueError is an enum value, ValueError(stringvar) cannot work |
08:24:30 | FromGitter | <tim-st> that's what I assumed, can it be pure enum, does it work then? |
08:25:00 | FromGitter | <Araq> what has that to do with anything |
08:25:00 | FromGitter | <tim-st> hm, pure enum for exception is not cool |
08:31:15 | FromGitter | <gogolxdong> compile gSOAP got cannot find -ly , what is it exactly? |
08:51:10 | skrylar | that is yacc's runtime library |
08:51:46 | FromGitter | <mratsim> @gogolxdong, @zacharycarter Py2nim worked for porting part of Py-evm https://github.com/ethereum/py-evm to Nimbus |
08:52:04 | FromGitter | <mratsim> you have to ask @alehander42 if it does not compile anymore though |
08:53:36 | FromGitter | <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:59 | FromGitter | <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:09 | FromGitter | <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:03 | FromGitter | <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:05 | FromGitter | <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:05 | FromGitter | ... 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:43 | FromGitter | <Varriount> Araq: What about the case where that translation is needed? |
11:36:25 | FromGitter | <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:16 | FromGitter | <Varriount> It seems like this new exception architecture prevents that from being easily possible. |
11:40:28 | FromGitter | <Araq> it's just a ProtocolError with some additional info somewhere. |
11:40:41 | FromGitter | <Araq> and as usual, the additional info is purely debugging-related. |
11:44:39 | FromGitter | <Varriount> There are non-debugging cases - for example, an client handling an http 404, or some other specific error code. |
11:44:45 | FromGitter | <Varriount> Does this new architecture allow references to that information to be kept? |
11:46:17 | FromGitter | <Araq> http is yet another example that does well with a fixed number of error codes. |
11:47:36 | FromGitter | <Araq> any successful error handling model lists the possible error codes, it's the "extensibility" aspect that does not work at all. |
11:51:29 | FromGitter | <Varriount> There are times when extensibility is needed. |
11:57:12 | FromGitter | <Araq> yeah and you simply can't name these times, right? |
11:57:39 | FromGitter | <Varriount> I can. |
11:58:10 | dom96 | There are many protocols that are built on HTTP |
11:58:18 | dom96 | And they can use non-standard error codes |
11:58:45 | FromGitter | <Varriount> Also, C code too. |
11:59:35 | FromGitter | <Araq> yeah and they are all mapped to a fixed set of error cases. |
12:00:03 | FromGitter | <Araq> like the `MyError` example that *is* an `IoError`. |
12:00:29 | FromGitter | <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:46 | FromGitter | <Varriount> Also, what if I want to achieve details with an error, for logging purposes? |
12:01:53 | dom96 | This RFC is depressing |
12:02:08 | FromGitter | <Araq> then you get the error message. |
12:02:49 | FromGitter | <Varriount> Araq: But from what I've heard, essentially the error is an enum. |
12:03:11 | FromGitter | <Varriount> dom96: Where is the RFC? |
12:03:16 | dom96 | https://github.com/nim-lang/Nim/issues/8363 |
12:03:21 | FromGitter | <Varriount> I've just read the post on the forum. |
12:04:25 | FromGitter | <Varriount> Hm, that RFC essentially looks like C error codes. |
12:08:30 | * | enthus1ast joined #nim |
12:12:31 | dom96 | I replied with a possibly less disruptive solution |
12:15:52 | FromGitter | <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:59 | dom96 | I 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:30 | enthus1ast | any suggestion to fix this? https://gist.github.com/enthus1ast/13a7e9b8af865cfc5afe685b9f130ca4 |
12:19:53 | enthus1ast | this fails with "Error: ordinal type expected" |
12:19:54 | stefanos82 | Araq: is the reason for replacing future with sugar as a pun for "syntactic sugar"? |
12:21:06 | dom96 | stefanos82: yes |
12:21:27 | stefanos82 | dom96: very nice. |
12:23:52 | FromGitter | <tim-st> enthus1ast: it does only work if you remove the explicit valued from your enum |
12:24:25 | FromGitter | <tim-st> I think it's because the bitset needs special numbers that are created by compiler but maybe I'm wrong |
12:24:53 | enthus1ast | tim-st i know, but i still wonder why its not possible (now), it was working |
12:25:27 | enthus1ast | (i know that it works withouth the xFF) |
12:25:58 | FromGitter | <tim-st> maybe as a workaround create all missing enums with default ones such that the values fit^^ |
12:26:10 | FromGitter | <tim-st> I think it's a bug |
12:26:18 | FromGitter | <Araq> @dom96 thanks for your input, I replied and I now have an even better idea... *cough* |
12:27:23 | FromGitter | <Araq> @enthus1ast the enum is clearly not an ordinal, but I am thinking of allowing enum with holes in the set construction |
12:28:04 | enthus1ast | Araq: it was working a few month ago |
12:29:13 | enthus1ast | or better is enum the right datatype for what i do here? :) |
12:30:32 | FromGitter | <tim-st> I would delete the `.byte` from the enum values I think it has no effect |
12:30:46 | stefanos82 | I 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:58 | enthus1ast | stefanos82: lines with ## will show up in nim docs |
12:32:11 | stefanos82 | ah cool, I didn't know! |
12:33:47 | FromGitter | <Araq> so ... I could now edit my RFC but then the comments would refer to an outdated version |
12:34:33 | FromGitter | <Araq> should I just reply, listing my differences? |
12:34:55 | FromGitter | <kaushalmodi> @Araq You can keep the older RFC untouched.. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50856f55a7e23c015174c1] |
12:35:32 | FromGitter | <kaushalmodi> in the v1 portion, strikethrough (`~~foo~~`) all the now not relevant stuff |
12:39:25 | PMunch | Is there a way with unit tests to check if it echos something? |
12:43:52 | FromGitter | <Araq> @kaushalmodi ok, thanks |
12:45:27 | * | skrylar quit (Ping timeout: 240 seconds) |
12:45:36 | FromGitter | <codem4ster> Hi folks, I'm trying to learn futures in Nim, and it looks like promises in javascript, I think. |
12:46:13 | FromGitter | <codem4ster> I tried something like this, without luck ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508815a94c525552417414] |
12:47:30 | FromGitter | <codem4ster> I'm trying to print James Bond asyncly in 3000 millisec and want to stop the main program 1sec after this |
12:47:44 | FromGitter | <codem4ster> how can I achieve this with |
12:49:48 | FromGitter | <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:31 | FromGitter | <codem4ster> could you provide a running code for my example? |
12:56:29 | FromGitter | <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:54 | FromGitter | <Yardanico> because usually you would have a main proc which will call all other needed procedures with `await` or `asyncCheck` |
12:58:12 | FromGitter | <Yardanico> like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508ae41539a7040cebd3b4] |
12:58:52 | * | nsf joined #nim |
12:59:28 | FromGitter | <Yardanico> oh, and quit() call is optional here |
12:59:28 | FromGitter | <codem4ster> I know. I just trying to understand Future behaviors. |
12:59:55 | FromGitter | <Yardanico> @Araq btw, is this a bug or intended behaviour: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b508b4bad8d085553b027f4] |
13:00:28 | FromGitter | <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:49 | FromGitter | <Yardanico> os.sleep(ms) is blocking, it will block the entire program and stop all async procedures until it completes |
13:01:40 | FromGitter | <codem4ster> hmm, got it. So then, async functions isn't running inside another thread? |
13:02:14 | FromGitter | <Yardanico> no, they're running in the same thread |
13:02:46 | FromGitter | <Yardanico> however you can actually have multiple async dispatchers in different threads (like httpbeast does for example) |
13:03:27 | FromGitter | <codem4ster> then asynchttpclient is handling requests in main thread? |
13:03:38 | FromGitter | <Yardanico> you mean `asynchttpserver`? yes it does |
13:03:47 | FromGitter | <codem4ster> ahh sorry, yes |
13:03:56 | FromGitter | <Yardanico> async in nim is implemented via iterators and `async` macro |
13:04:44 | FromGitter | <codem4ster> it looks like fibers in crystal |
13:05:17 | FromGitter | <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:39 | FromGitter | <Yardanico> there are channels in nim for thread communication btw |
13:06:58 | FromGitter | <Yardanico> but usually for IO stuff you will use async |
13:07:10 | FromGitter | <Yardanico> for IO-bound programs I mean |
13:07:47 | enthus1ast | with stdin as a exception |
13:07:55 | FromGitter | <codem4ster> Got it. I want an http server that supports parallelism, for speed reasons. |
13:08:25 | FromGitter | <Araq> then use httpbeast. |
13:08:27 | FromGitter | <Yardanico> `httpbeast` is async and multithreaded :) |
13:08:38 | FromGitter | <Yardanico> also there's `mofuw` |
13:09:06 | FromGitter | <Yardanico> @codem4ster https://github.com/dom96/httpbeast, https://github.com/2vg/mofuw |
13:09:12 | FromGitter | <codem4ster> I tried mofuw but it didn't respond to apache ab tests in windows10 |
13:09:31 | FromGitter | <Yardanico> oh, you're on windows |
13:09:41 | FromGitter | <codem4ster> no I'm on multiplatform |
13:09:43 | FromGitter | <codem4ster> :D |
13:09:56 | FromGitter | <Yardanico> httpbeast doesn't support windows :) |
13:10:29 | FromGitter | <codem4ster> hmm interesting. Why? Nim is cross platform. |
13:11:01 | FromGitter | <Yardanico> well, it doesn't mean that all programs will be cross platform |
13:11:03 | dom96 | because almost everyone uses linux on servers |
13:11:45 | euantor | it 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:49 | Yardanico | dom96, btw, that means that jester doesn't work on windows anymore? |
13:11:50 | enthus1ast | most servers i had to support where windows |
13:11:56 | enthus1ast | just saying |
13:12:15 | dom96 | Yardanico: nope, it falls back to asynchttpserver |
13:12:19 | FromGitter | <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:21 | Yardanico | ok, that's good |
13:13:01 | dom96 | I don't have a Windows machine right now so I don't have much ability to implement Windows support for httpbeast |
13:13:26 | Yardanico | @codem4ster is it windows 10? |
13:13:35 | Yardanico | if it's windows 10, why not just use WSL |
13:13:37 | FromGitter | <codem4ster> yep |
13:13:48 | FromGitter | <codem4ster> WSL? |
13:13:54 | Yardanico | windows subsystem for linux |
13:14:00 | dom96 | Also, Windows requires a completely different approach |
13:14:16 | FromGitter | <codem4ster> ahh I personally don't like that |
13:14:20 | Yardanico | @codem4ster |
13:14:20 | Yardanico | <FromGitter> <codem4ster> WSL? |
13:14:22 | Yardanico | oh sorry |
13:14:27 | Yardanico | https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux |
13:14:46 | FromGitter | <codem4ster> it performs slow, so I don't benchmark things well. |
13:14:54 | Yardanico | IO is slow, CPU is good |
13:15:23 | FromGitter | <codem4ster> and the another point is testing cross platform :) |
13:16:07 | FromGitter | <codem4ster> ok not so important. I have a VM on job. I was just curious about windows support. |
13:18:18 | FromGitter | <codem4ster> I also tested Jester's simple example with my VS code, but it hangs with "Indexing: 1" at the bottom right. |
13:18:37 | FromGitter | <codem4ster> may be because I'm on a windows platform. |
13:18:57 | PMunch | Hmm, is there a way to properly overwrite != |
13:19:14 | PMunch | I have some issues where it uses == instead and just negates the result.. |
13:19:15 | Yardanico | @codem4ster it works fine for me |
13:22:33 | euantor | @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:07 | dom96 | Not really |
13:23:16 | dom96 | Windows is fundamentally different |
13:23:31 | FromGitter | <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:34 | dom96 | So much so that I would say it would be better to have a separate project for it |
13:23:44 | FromGitter | <Yardanico> @codem4ster I doubt that this is possible |
13:24:04 | FromGitter | <Yardanico> well, it is, but you will need to use pointers |
13:24:10 | FromGitter | <Yardanico> threads in nim have thread-local GC |
13:25:10 | FromGitter | <Yardanico> well, I'll try |
13:26:39 | dom96 | That seems like a completely arbitrary and artificial task |
13:26:48 | dom96 | What are your actual use cases for threads? |
13:27:41 | * | couven92 joined #nim |
13:28:19 | FromGitter | <Yardanico> well, it works : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5091f38fe2780689c42b2b] |
13:28:54 | FromGitter | <codem4ster> ah grrreaat. I will test now :D |
13:29:59 | FromGitter | <codem4ster> Error: undeclared identifier: 'Thread' |
13:30:33 | FromGitter | <Yardanico> @codem4ster you need to compile with `--threads:on` as stated in documentation |
13:31:14 | FromGitter | <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:16 | FromGitter | <codem4ster> thank you very much @Yardanico, it works in windows also :D |
13:32:37 | FromGitter | <Yardanico> yes, threads are cross-platform |
13:33:29 | FromGitter | <codem4ster> is Nim prevents deadlocks on `i`? |
13:33:50 | FromGitter | <Yardanico> probably not, there are locks for this |
13:33:57 | FromGitter | <Yardanico> I don't really use threads in Nim so I can't answer for sure |
13:35:39 | FromGitter | <codem4ster> I tested it doesn't give into a deadlock. That's great. :D |
13:35:57 | Yardanico | but you should probably use locks anyway :) |
13:36:03 | FromGitter | <codem4ster> just remove sleeps and try :D |
13:36:21 | Yardanico | and 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:09 | FromGitter | <codem4ster> I asked this for parallelism at first :( |
13:40:02 | FromGitter | <codem4ster> but I think sharing variables between processors is a harder task |
13:41:09 | FromGitter | <Yardanico> what do you mean? |
13:41:27 | FromGitter | <Yardanico> threads in nim are like real system threads, they can run at different processor cores |
13:43:53 | FromGitter | <codem4ster> hmm, in Ruby parallelism and concurrency is different things. |
13:44:27 | FromGitter | <codem4ster> Ruby parallelism is forks and concurrency is threads |
13:45:05 | FromGitter | <codem4ster> threads are opening only in the same core of the main program |
13:45:42 | FromGitter | <Yardanico> Ruby has gil like python, that's why |
13:45:50 | FromGitter | <Araq> that's called a "global interpreter lock" and is nothing to boast about. |
13:46:20 | FromGitter | <codem4ster> I always thought threads always must work on the same core :) What a shame. |
13:46:48 | FromGitter | <codem4ster> thanks for your helps now I love Nim 2x more :P |
13:49:17 | FromGitter | <codem4ster> @Araq you mentioned about elm architecture on your previous posts |
13:49:19 | FromGitter | <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:58 | FromGitter | <codem4ster> but thats more about frontend and SPA applications |
13:50:06 | FromGitter | <tim-st> @codem4ster I also only found out about this a few days ago^^ |
13:50:38 | FromGitter | <tim-st> but there cant share memory if I understood correct |
13:50:41 | FromGitter | <Yardanico> @codem4ster nim can be used as a frontend |
13:50:42 | FromGitter | <tim-st> *they |
13:50:59 | FromGitter | <Yardanico> @tim-st you can share GC'd memory AFAIK |
13:51:07 | FromGitter | <Yardanico> oh sorry |
13:51:09 | FromGitter | <Yardanico> *you can't |
13:51:22 | * | dddddd joined #nim |
13:51:23 | FromGitter | <tim-st> what means gced mem? all ref types? |
13:51:25 | FromGitter | <Yardanico> But you can share non-GC'd memory like in the example above with two threads and one global `i` int |
13:51:45 | FromGitter | <Araq> @tim-st you can do this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b5097714b583a74a729aa97] |
13:52:13 | FromGitter | <tim-st> @Araq thanks, that makes sense! |
13:53:29 | FromGitter | <tim-st> but I think it has overhead when I create one object type for each kind |
13:53:35 | FromGitter | <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:48 | FromGitter | <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:12 | FromGitter | <Yardanico> well, you need to compile via `-d:release `and JS size will not grow dramatically with more stuff |
13:54:26 | FromGitter | <Araq> the produced JS is good and will only get better. |
13:54:56 | * | endragor joined #nim |
13:55:07 | FromGitter | <codem4ster> I examine the snake game. Is that compiled with -d:release ? |
13:55:15 | * | TheLemonMan joined #nim |
13:56:13 | FromGitter | <Yardanico> let me see.. |
13:56:21 | FromGitter | <codem4ster> https://picheta.me/snake/ this is not a good. |
13:57:20 | FromGitter | <Yardanico> it's not in release mode lol |
13:57:36 | TheLemonMan | Araq, give a look at #8095 when you have some time, we need some (breaking?) changes to winlean |
13:57:49 | FromGitter | <Yardanico> @codem4ster because it's not compressed |
13:57:56 | FromGitter | <Yardanico> you can use clojure compiler to minify js |
13:58:57 | * | endragor quit (Ping timeout: 240 seconds) |
13:59:12 | FromGitter | <codem4ster> you misunderstood. :) I mean too much non DRY un-optimised code in there. |
13:59:27 | FromGitter | <codem4ster> I know its not a compressed one :P |
13:59:37 | TheLemonMan | hmm, if I leave src/mylibname.nim |
13:59:45 | TheLemonMan | ehh, ignore that |
14:00:09 | FromGitter | <Yardanico> @codem4ster but resulting JS code is not meant to be read by real people |
14:00:32 | FromGitter | <Yardanico> and I get ~224kb in release mode with snake game, is that bad? I don't think it is |
14:00:36 | FromGitter | <codem4ster> I'm looking for the filesize not readability :( |
14:00:41 | FromGitter | <Yardanico> and that's without any compression/clojure compiler |
14:01:06 | FromGitter | <Yardanico> forum.nim-lang.org uses nim as a frontend as well |
14:01:14 | FromGitter | <Yardanico> https://forum.nim-lang.org/ |
14:01:18 | FromGitter | <codem4ster> may be I can give chance, and gather data about js side. |
14:02:11 | FromGitter | <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:01 | FromGitter | <Yardanico> oh, and snake.js is only 35kb (because picheta.me uses cloudflare) |
14:04:08 | FromGitter | <Yardanico> I mean it's 35kb to download for the client |
14:04:32 | FromGitter | <codem4ster> gzipped version? |
14:04:47 | FromGitter | <Yardanico> brotli'd version |
14:04:52 | FromGitter | <Yardanico> `br` encoding |
14:05:45 | FromGitter | <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:16 | FromGitter | <codem4ster> hmm sounds good. What about external libraries? Can I use them in my Nim code? |
14:07:23 | * | couven92 joined #nim |
14:07:27 | FromGitter | <Yardanico> of course, you can interface with any JS libraries |
14:08:52 | FromGitter | <codem4ster> ok I will try and see how it looks like. |
14:09:57 | FromGitter | <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:41 | FromGitter | <tim-st> @Araq should it be unreachable code bug if all cases are checked and an `else` is there? |
14:13:54 | FromGitter | <tim-st> *error not bug |
14:14:49 | FromGitter | <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:45 | FromGitter | <Araq> currently the spec says something like "an else prevents the exhaustiveness check" |
14:18:18 | FromGitter | <Araq> and so it's accepted and doesn't count as unreachable code |
14:18:43 | FromGitter | <tim-st> ah, ok, thanks |
14:19:20 | * | couven92 quit (Remote host closed the connection) |
14:19:40 | * | couven92 joined #nim |
14:21:12 | FromGitter | <gemath> Is there a way to start the Travis CI build for Nim manually (without committing)? |
14:21:55 | FromGitter | <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:27 | FromGitter | <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:14 | FromGitter | <Yardanico> @codem4ster or (modern way) - create `filename.nims` and write `switch("threads")` |
14:24:30 | FromGitter | <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:51 | FromGitter | <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:29 | FromGitter | <codem4ster> thanks @Yardanico is this documented anywhere? |
14:28:36 | FromGitter | <Yardanico> yes it is |
14:28:50 | FromGitter | <Yardanico> https://nim-lang.org/docs/threads.html `--threads:on` |
14:29:07 | FromGitter | <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:37 | stefanos82 | what 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:40 | Yardanico | stefanos82, you have one main file in your program |
14:31:58 | stefanos82 | fair enough |
14:33:58 | * | donlzx joined #nim |
14:41:58 | FromGitter | <codem4ster> Is there any plan or thoughts to add sub-modules to the language? |
14:42:06 | Yardanico | what do you mean by that? |
14:43:46 | * | brainproxy joined #nim |
14:45:20 | FromGitter | <codem4ster> may be myVeryOwnFramework::Routes |
14:45:43 | FromGitter | <codem4ster> routes in here is a submodule |
14:46:00 | FromGitter | <Yardanico> you can of course do that |
14:46:08 | FromGitter | <codem4ster> how? |
14:47:02 | subsetpark | codem4ster: do you just mean putting files into directorys? you can have hierarchical namespaces |
14:48:25 | FromGitter | <codem4ster> ok I got it |
14:49:05 | FromGitter | <codem4ster> it only doesn't work when the sub-module name is same with another |
14:49:09 | FromGitter | <codem4ster> it must be unique |
14:49:55 | stefanos82 | Araq: is it possible to overload backticks? |
14:49:56 | * | couven92 quit (Remote host closed the connection) |
14:50:21 | FromGitter | <codem4ster> but this leads into that its not a sub-module also :( |
14:50:31 | Yardanico | @codem4ster why? |
14:50:37 | FromGitter | <codem4ster> every sub-module also a module |
14:50:50 | FromGitter | <Yardanico> yes, and why that's bad? |
14:51:07 | * | couven92 joined #nim |
14:51:19 | FromGitter | <codem4ster> because a::b is different from c::b |
14:52:08 | FromGitter | <codem4ster> also a:🅱️:c is different from c |
14:52:57 | FromGitter | <Yardanico> if you have a module in myframework/utils/module.nim you can't import it by "import module" |
14:53:40 | FromGitter | <codem4ster> I know and I must be |
14:54:42 | FromGitter | <codem4ster> but ./myframework/utils/module.nim and ./module.nim cannot be declared at the same time, right? |
14:54:48 | Yardanico | yes they cannot be |
14:55:16 | stefanos82 | Yardanico: 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:24 | PMunch | Doing 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:33 | PMunch | Struggling with implementing != for options.. |
14:57:18 | FromGitter | <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:18 | PMunch | Nim seems to insist that != is converted to not == |
14:57:45 | * | PMunch quit (Quit: Leaving) |
14:59:27 | FromGitter | <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:31 | Yardanico | @codem4ster well, he was new to nim, that's why he promotes things like "from x import a, b, c" |
15:01:22 | Yardanico | "import failure" did he make a bug report? |
15:05:32 | Yardanico | and his app doesn't look like best nim practices :) |
15:05:46 | FromGitter | <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:07 | FromGitter | <Araq> because you know, "module a" is then totally ambiguous. |
15:09:17 | FromGitter | <Quelklef> i just read "framework/utils/module" as "framework utils module" |
15:09:34 | FromGitter | <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:10 | FromGitter | <tim-st> is it expected that `echo getOccupiedMem()` works and `echo getOccupiedMem` doesnt? |
15:39:08 | FromGitter | <tim-st> `echo "".len` and `echo "".len()` works both |
15:39:32 | dom96 | yes, you're trying to echo a proc type |
15:40:04 | * | couven92 quit (Remote host closed the connection) |
15:40:20 | FromGitter | <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:41 | Yardanico | no, with "".len you do len("") |
15:41:33 | * | couven92 joined #nim |
15:42:04 | FromGitter | <tim-st> hm, ok, not 100% expected, thought this a few times before |
15:53:17 | FromGitter | <Quelklef> yeah what exactly is the disambiguation process for this? |
15:57:53 | FromGitter | <Quelklef> Ok, here's what I've found out: |
15:58:00 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50b507ad8d085553b0ba5e] |
15:58:41 | miran | because `2.C` is the same as `C(2)` |
15:59:50 | FromGitter | <Quelklef> right |
16:00:55 | FromGitter | <Quelklef> I thought the ability to omit `()`s in proc calls was more flexible than it actually is |
16:02:04 | miran | to be honest, even where i could omit it, i usually keep it to better differentiate some `x.field` from `x.function()` |
16:02:58 | FromGitter | <Quelklef> Yeah |
16:03:13 | FromGitter | <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:04 | FromGitter | <Araq> I leave them out more and more. every line is a function call. |
16:33:49 | * | couven92 quit (Quit: Client disconnecting) |
16:36:54 | FromGitter | <Quelklef> "every line is a function call |
16:36:59 | FromGitter | <Quelklef> " come again? |
16:38:53 | * | yglukhov[i] quit (Remote host closed the connection) |
16:41:30 | FromGitter | <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:59 | FromGitter | <Araq> no, not "sometimes", it's clearly written down in the manual |
16:47:09 | * | krux02 joined #nim |
16:47:28 | FromGitter | <Araq> foo() aka "nullary function calls" are the only calls where the () cannot be avoided |
16:49:52 | FromGitter | <tim-st> In the following case only a function call is possible: |
16:49:56 | FromGitter | <tim-st> proc test() = echo "test" ⏎ test |
16:50:21 | FromGitter | <tim-st> so when it's flexible for all other ways, I'd expect it for this case too |
16:51:15 | FromGitter | <tim-st> for all other cases I'd expect the compiler to findout by looking whether the type fits |
16:51:30 | FromGitter | <Quelklef> Noooooo, it should not depend on the typing |
16:51:32 | FromGitter | <Araq> proc test() = echo "test" ⏎ proc x(): proc() = test # kaboom. |
16:51:35 | FromGitter | <tim-st> if 2 or more are fitting the error message is expected, else not imo |
16:51:47 | FromGitter | <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:11 | FromGitter | <Quelklef> Also, it'd mean that adding a proc can cause errors in an unrelated portion of code |
16:54:11 | krux02 | scala 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:12 | FromGitter | <Quelklef> consider; |
16:54:15 | * | dorelix joined #nim |
16:54:47 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c257cad358639d672079] |
16:54:56 | FromGitter | <Quelklef> @krux02 Ruby does something similar, right? |
16:55:06 | krux02 | I don't know ruby at all |
16:55:07 | FromGitter | <Quelklef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c26b623cc3040b30bb44] |
16:55:26 | FromGitter | <Quelklef> Ah |
16:55:55 | FromGitter | <tim-st> @Quelklef As I said above: "if 2 or more are fitting the error message is expected, else not imo" |
16:56:29 | FromGitter | <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:49 | FromGitter | <Quelklef> I suppose some similar things exist already (e.g. namespace conflicts), but... |
16:57:59 | FromGitter | <tim-st> yes, but imo the error is good here, because the code you have shown is in fact very bad |
16:58:25 | FromGitter | <tim-st> well, atleast for this example^^ |
16:58:30 | FromGitter | <Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b50c336ad8d085553b0eb9e] |
16:58:40 | FromGitter | <Quelklef> I'm not disagreeing that there should be an error... |
16:59:00 | FromGitter | <Quelklef> That example's even better |
16:59:15 | FromGitter | <krux02> pure functional languages alse are able to make a value and a function with 0 argumenst syntactically identical |
16:59:32 | FromGitter | <krux02> because it doesn't matter semantically, a function may not have side effects |
16:59:36 | FromGitter | <tim-st> what's wrong with the example? I think local name as higher prio |
16:59:38 | FromGitter | <Araq> I think that's only true for 'lazy' languages |
16:59:44 | FromGitter | <krux02> but Nim isn't pure functional |
16:59:58 | FromGitter | <krux02> no it is not |
17:00:19 | FromGitter | <krux02> a function doesn't need to be lazy for that, but it needs to be purly functional. |
17:00:29 | FromGitter | <tim-st> i dont want to say that I call function like `test` I prefer brackets |
17:00:32 | FromGitter | <Araq> not a function, the language. |
17:00:43 | FromGitter | <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:51 | FromGitter | <tim-st> but I coped the proc from Araq's packedjson without brackets and was suprised |
17:00:56 | FromGitter | <tim-st> *copied |
17:01:11 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
17:03:07 | FromGitter | <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:16 | FromGitter | <Araq> cause these types are definitely not the same, side-effects or not. |
17:04:17 | FromGitter | <Quelklef> Typically `() -> T` can't exist in PF language |
17:04:54 | FromGitter | <Araq> ah ok. that might work. |
17:06:38 | FromGitter | <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:07 | FromGitter | <Quelklef> Uck, really? |
17:07:40 | FromGitter | <Araq> doesn't this require an `&` in Ruby. never learned the language though. |
17:08:02 | FromGitter | <mratsim> the only pure functional language i know of are Haskell and Idris though @krux02 |
17:08:10 | FromGitter | <Quelklef> IIRC, the `&` is in the recieve proc definition. It requires something tho |
17:08:18 | FromGitter | <Quelklef> @mratsim Curry too |
17:08:38 | FromGitter | <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:39 | FromGitter | <mratsim> does Ocaml make 0 arg function and value syntactically identical for example? |
17:09:37 | FromGitter | <mratsim> @Quelklef never heard of curry. |
17:10:18 | FromGitter | <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:28 | FromGitter | <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:44 | FromGitter | <krux02> and in f# there are aparently problems: https://stackoverflow.com/questions/2797662/f-function-with-no-arguments |
17:12:17 | FromGitter | <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:37 | FromGitter | <Quelklef> Yes, they're both markdown-based |
17:12:43 | * | nsf joined #nim |
17:12:50 | FromGitter | <tim-st> ```nim echo "test"``` |
17:12:55 | FromGitter | <tim-st> doesnt work |
17:13:08 | FromGitter | <tim-st> ```echo "test"``` |
17:13:15 | FromGitter | <Quelklef> three backticks, "nim", newline, code, newline, three backticks |
17:13:42 | FromGitter | <krux02> ```` ```nim ```` |
17:13:45 | FromGitter | <tim-st> ```echo "test"``` |
17:13:48 | FromGitter | <Quelklef> tada |
17:13:59 | FromGitter | <tim-st> yes, thanks, but I cannot do it from the input directly |
17:14:04 | FromGitter | <tim-st> have to copy paste |
17:14:10 | FromGitter | <Quelklef> ...huh |
17:14:15 | FromGitter | <tim-st> or? |
17:14:24 | FromGitter | <codem4ster> I think paranthesis must be mandatory although I'm coming from a Ruby world. |
17:14:31 | FromGitter | <krux02> I usually write it in an editor anyway, so it's not that much of a problem |
17:14:49 | FromGitter | <tim-st> ok, it works, good to know, thanks |
17:14:54 | FromGitter | <rayman22201> @tim-st shift enter |
17:15:08 | FromGitter | <tim-st> yes, I now saw a template is created in the input field |
17:19:30 | FromGitter | <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:03 | FromGitter | <codem4ster> and you cannot define a method inside this map function call, you must define inc before |
17:22:26 | FromGitter | <Quelklef> Can't you do like `[1, 2, 3].map {|i| i + 1}`? |
17:22:51 | FromGitter | <codem4ster> yes you can but this is not defining a method |
17:23:51 | FromGitter | <codem4ster> and you cannot move `{ ... }` anywhere |
17:23:57 | * | yglukhov[i] joined #nim |
17:24:48 | FromGitter | <codem4ster> this is a proc and procs are a bit different than methods |
17:24:50 | * | jjido quit (Ping timeout: 276 seconds) |
17:25:10 | FromGitter | <codem4ster> because of their scope |
17:25:30 | FromGitter | <rayman22201> Why do you want to do that? Nim is not an OOP language like Ruby |
17:26:05 | krux02 | Yes nim is superior to OOP |
17:26:06 | krux02 | :P |
17:26:15 | FromGitter | <Quelklef> ^ |
17:27:14 | FromGitter | <rayman22201> Lol |
17:28:34 | FromGitter | <Quelklef> I tried to understand ruby's approach to functional programming once |
17:28:37 | FromGitter | <Quelklef> I don't plan on going back, lol |
17:31:24 | FromGitter | <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:25 | FromGitter | <codem4ster> Ruby has nearly perfect OOP techniques but not good at functional programming I think |
17:32:45 | FromGitter | <Quelklef> grrr, like Python |
17:33:16 | FromGitter | <Quelklef> I like Python but damn if it isn't one of the more painful languages to do functional things in |
17:33:38 | FromGitter | <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:01 | FromGitter | <Quelklef> Wait, actually I think I'm misremembering |
17:34:25 | krux02 | Quelklef: I think java got a lot of it's features from scala. |
17:34:30 | * | yglukhov[i] quit () |
17:34:37 | FromGitter | <Quelklef> Java might be `ar.stream().map(e -> e + 1).collect(Collectors.toList())` |
17:35:12 | FromGitter | <Quelklef> Scala is good OOP/FP, right? I never learned it :\ |
17:35:32 | FromGitter | <codem4ster> but Ruby has simply perfect module and include system I have ever seen |
17:35:41 | krux02 | Martin 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:50 | krux02 | One of them is I think the lambda syntax. |
17:36:06 | FromGitter | <Quelklef> Oh wow |
17:36:50 | FromGitter | <Quelklef> Is that where JS' lambda syntax comes from too? |
17:36:51 | krux02 | so your example worked like that in Scala in 2010 when I learned it. |
17:37:10 | * | yglukhov[i] joined #nim |
17:37:14 | krux02 | don't ask me about JS, I avoid that language |
17:37:23 | krux02 | too many people have an opinion abuot that. |
17:37:31 | * | UxerUospr joined #nim |
17:37:33 | FromGitter | <Quelklef> hahahah |
17:38:11 | FromGitter | <mratsim> Too many languages to avoid, Java, JS, PHP … I just can’t get out they are everywhere |
17:38:28 | FromGitter | <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:31 | krux02 | some 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:28 | krux02 | Araq: from my experience with scala I can tell you that is not true |
17:39:32 | krux02 | yes it is a lot of overhead |
17:39:38 | krux02 | but it changed my way of thinking about loops |
17:39:55 | krux02 | it gave a lot of operations that I did in a loop a clear name |
17:40:05 | FromGitter | <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:22 | krux02 | I still think about map fold reduce and all that stuff when I write my loops, |
17:40:47 | krux02 | I just don't write ``map`` and that stuff down anymore, because I like to prevent the overhead |
17:42:30 | krux02 | What 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:52 | FromGitter | <Quelklef> hmmmmmm |
17:43:10 | FromGitter | <Quelklef> That's not even 100% true in Haskell, so I have trouble believing you |
17:43:18 | krux02 | I never had null pointer exceptions or other unexpecting behaviour |
17:43:40 | krux02 | I don't want to say that you can't break it |
17:44:21 | krux02 | you can cause NullPointerException and that stuff, but the language really encourages you to write in a style that doesn't do that |
17:44:41 | FromGitter | <Quelklef> right |
17:44:45 | FromGitter | <Quelklef> your claim was just a bit strong |
17:45:31 | krux02 | The reason I stopped using scala was that is has too much overhead for it's data types |
17:45:55 | krux02 | (generally true for all "true" OOP languages) |
17:46:07 | krux02 | too long compilation times |
17:46:11 | krux02 | (also true for c++) |
17:46:19 | FromGitter | <Quelklef> You're not a fan of AbstractProxyFactoryHandlers? |
17:46:43 | FromGitter | <rayman22201> https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html?m=1 |
17:46:54 | FromGitter | <rayman22201> :-P |
17:46:57 | krux02 | and no flat memory data structures. Only ByteBuffer |
17:47:17 | krux02 | Quelklef: the scala land doesn't do that |
17:47:36 | FromGitter | <Quelklef> gaw bless |
17:47:54 | krux02 | but since scala can just use everything that has been written in Java, you are not entirely safe from it. |
17:48:04 | krux02 | depends on what libraries you use. |
18:01:02 | * | yglukhov[i] quit (Remote host closed the connection) |
18:02:36 | FromGitter | <mratsim> @codem4ster to avoid polluting namespace |
18:09:45 | krux02 | @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:30 | krux02 | but 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:57 | UxerUospr | I 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:34 | UxerUospr | Particularly: required type: Stream |
18:11:37 | UxerUospr | but expression 's' is of type: Stream |
18:12:05 | UxerUospr | I realize now that it was complaining that I didn't have a TaintedString |
18:12:54 | Perkol | Hi. I want to ignore exceptions from myfunc() am I doing it right? https://bpaste.net/show/646da83bcde4 |
18:13:53 | krux02 | UxerUospr, I don't know why you think the error message was unhelpful |
18:14:30 | UxerUospr | "Require type: Stream but expression ... is of type: Stream" |
18:14:30 | krux02 | no wait |
18:14:32 | krux02 | that is a bug |
18:14:43 | krux02 | yes that is a bug |
18:14:50 | krux02 | you should report it is the issue tracker |
18:14:57 | krux02 | it should complain about the second parameter |
18:15:01 | UxerUospr | Okay, thanks for looking! |
18:15:20 | FromGitter | <Quelklef> @Perkol yes, I think so, but you shouldn't be ignoring all exceptions |
18:16:01 | krux02 | @Perkol there is a difference between ignoring exceptions and discarding excepitons |
18:16:43 | krux02 | what you are doing is discarding all exceptions. That is always a bad thing to do. |
18:17:24 | krux02 | it prevents you from finding the source of a problem if an excepiton actually comes up |
18:17:38 | FromGitter | <Quelklef> Why, @krux02, whatever do you mean? The more `try {} catch {}` I add, the less errors my code will throw... |
18:18:15 | krux02 | no |
18:18:31 | krux02 | it will still throw the same amount of error, you catch them and discard them |
18:18:42 | FromGitter | <Quelklef> exactly. the more catch, the less crash |
18:18:46 | krux02 | basically throwing away information in the trash |
18:18:47 | FromGitter | <Quelklef> it rhymes so it must be wise |
18:19:16 | krux02 | if you write a catch, then you should deal with the error |
18:19:43 | krux02 | if 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:55 | FromGitter | <Quelklef> I'm not serious mate |
18:20:04 | krux02 | I was worried |
18:20:16 | FromGitter | <Quelklef> lol |
18:22:02 | krux02 | there 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:43 | UxerUospr | Issue submitted: https://github.com/nim-lang/Nim/issues/8368 |
18:36:20 | krux02 | UxerUospr, you should mention what is acutally the problem in the error message |
18:36:35 | krux02 | and how the error message should be |
18:36:46 | krux02 | not how to fix your program. |
18:43:24 | krux02 | UxerUospr, when I test on current version of Nim, the error message is slightly better, but still wrong. |
18:46:58 | UxerUospr | I 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:22 | UxerUospr | I edited the issue to accomplish what you suggested |
18:47:36 | UxerUospr | krux02: thanks for the feedback |
18:50:09 | * | endragor joined #nim |
18:54:34 | krux02 | UxerUospr, i symlink nim always to ~/bin |
18:54:38 | krux02 | and put that in path |
18:55:11 | * | endragor quit (Ping timeout: 276 seconds) |
18:55:41 | UxerUospr | krux02: I do the same, but I also do nimble, nimgrep & nimsuggest |
18:55:59 | UxerUospr | and you have to remove the old symlinks first or will complain |
18:56:29 | UxerUospr | krux02: Easy enough, I know, I'm just very lazy |
18:56:46 | miran | choosenim to the rescue? |
18:58:31 | UxerUospr | miran: I should look into it :) |
18:58:58 | miran | it is quite easy and fool-proof (as confirmed by me) |
19:08:23 | * | Perkol quit (Quit: Leaving) |
19:41:17 | FromGitter | <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:24 | FromGitter | <tim-st> like iterator only |
19:44:45 | FromGitter | <tim-st> I expect such a parser to use 200kb ram at max |
19:45:19 | FromGitter | <tim-st> (besides big strings of course) |
19:47:57 | FromDiscord | <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:04 | FromGitter | <Varriount> @tim-st Not when the view that is exposed to the user is a tree view. |
19:58:20 | FromGitter | <tim-st> but which users want that? |
19:58:30 | FromGitter | <tim-st> I never had such a use case with json |
19:58:37 | FromGitter | <tim-st> I always iterate over it |
19:58:42 | FromGitter | <Varriount> Most people? The alternative is event based |
19:59:02 | FromGitter | <Varriount> JSON has both dictionary and list structures. |
19:59:07 | FromGitter | <tim-st> Do I need to read 100mb in a ram if I only want the len of current JsonNode? |
19:59:10 | krux02 | tim-st not really |
19:59:34 | krux02 | I think the best way to use packedjson is with memory mapped files |
19:59:53 | dom96 | huh, what's the point of packedjson if this is the case? |
19:59:55 | FromGitter | <tim-st> krux02: I'm currently building my own, I dont see why it shouldnt work |
20:00:10 | * | NimBot joined #nim |
20:00:25 | FromGitter | <tim-st> but isnt this memory somehow reserved? |
20:00:33 | krux02 | well it does work with a stream api, but then you are very limited in processing that json also like a stream |
20:00:40 | krux02 | so you will never be able to go back |
20:00:44 | * | Jesin joined #nim |
20:00:46 | FromGitter | <tim-st> yes, that's good |
20:00:50 | FromGitter | <tim-st> I can |
20:01:01 | FromGitter | <tim-st> at least I can save the last important start |
20:01:10 | krux02 | well when you can always go back then you need to store that somehow |
20:01:11 | FromGitter | <tim-st> It's a bit worse than seq but still ok |
20:01:52 | krux02 | tim-st: whatever you do, whatever you optimize you will always make it worse somewhere else |
20:01:56 | FromGitter | <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:03 | krux02 | there is no perfect solution for every use case |
20:02:23 | FromGitter | <tim-st> yes, what's the recommended way to declare iterator[T] ? concept? |
20:02:30 | krux02 | memory mapped files allow you to jump arbitrary and don't consume the memory physically |
20:02:49 | FromGitter | <tim-st> but what's the downside of them? |
20:02:51 | krux02 | but memory mapped files might be a bad idea when the virtual memory space is small |
20:02:54 | FromGitter | <tim-st> I saw lmdb uses this too |
20:03:16 | krux02 | yes, and I think memory mapped files is the way to go when you use 64 bit CPU |
20:03:51 | krux02 | on 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:00 | FromGitter | <tim-st> but I dont really see a pro point compared to parsing stream on the fly |
20:04:09 | FromGitter | <tim-st> because I have indices on the fly |
20:04:28 | FromGitter | <Varriount> Parsing a data structure on the fly is tedious. |
20:04:31 | krux02 | well 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:51 | krux02 | but it doesn't work with pipes in the file system |
20:05:12 | FromGitter | <tim-st> I think that's only true if you know for sure how you can access your data |
20:05:21 | FromGitter | <tim-st> but for json you have to parse first |
20:05:35 | krux02 | memory mapped files use the mmu unit to buffer parts of the file. |
20:05:41 | * | riidom_ quit (Ping timeout: 255 seconds) |
20:05:42 | FromGitter | <Varriount> @tim-st https://github.com/OpenSystemsLab/jsmn.nim |
20:05:49 | krux02 | and the mmu (memory management unit) is something that has to run anyway |
20:06:02 | krux02 | and with streams you have an additional indirection with the buffer |
20:06:34 | FromGitter | <tim-st> @Varriount thank will test this now |
20:06:37 | FromGitter | <tim-st> *thanks |
20:06:38 | krux02 | json you don't need to parse first. You can parse lazy. |
20:06:53 | FromGitter | <tim-st> That's what I meant of course |
20:07:31 | FromGitter | <tim-st> I dont see a human usable api for this lib |
20:07:40 | krux02 | and you can go back and forth in memory |
20:07:44 | krux02 | streams can only go forward |
20:08:29 | FromGitter | <Varriount> @tim-st As I said, event based parsers have usability issues. |
20:09:17 | FromGitter | <tim-st> When I see that this one works very good, I just wrap it for humans |
20:09:38 | FromGitter | <tim-st> very good regarding speed and mem |
20:11:23 | FromGitter | <rayman22201> @Varriount poke. We are awake at the same time! lol |
20:11:58 | FromGitter | <tim-st> @Varriount maybe I'm missing something, but the lib you linked loads the full string in memory |
20:12:11 | FromGitter | <tim-st> If my file has size 8gb this will break my system |
20:12:18 | FromGitter | <tim-st> I cannot use this lib |
20:12:52 | FromGitter | <tim-st> ah, you wrote this here: https://github.com/OpenSystemsLab/jsmn.nim/issues/2 |
20:13:52 | FromGitter | <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:25 | FromGitter | <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:58 | FromGitter | <tim-st> ok, but the lib linked doesnt use memory mapping |
20:16:11 | FromGitter | <rayman22201> mmap will "Map" your file to an address space, but it doesn't actually load all that into memory at once. |
20:16:46 | FromGitter | <tim-st> ok, sounds interesting at least, I'll read what others did with json and memory mapping |
20:18:31 | FromGitter | <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:37 | FromGitter | <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:58 | FromGitter | <tim-st> it parses it correctly but doesnt know what it is |
20:21:05 | FromGitter | <Araq> feel free to use parsejson.nim (new in devel) |
20:21:39 | FromGitter | <Araq> that only gives you the parser, it streams, you can then extract the length or whatever by token counting |
20:22:08 | FromGitter | <tim-st> ah, nice, I really searched for this via google, 0 matches |
20:22:29 | FromGitter | <tim-st> really was confused where you get this import from because I deactivated nimsuggest :\ |
20:25:10 | FromGitter | <tim-st> yes, that looks really helpful, thanks! |
20:29:12 | * | PMunch joined #nim |
20:29:38 | * | Vladar quit (Quit: Leaving) |
20:30:03 | FromGitter | <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:02 | FromGitter | <rayman22201> mmap doesn't actually fill your ram though |
20:32:42 | FromGitter | <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:56 | FromGitter | <tim-st> (compared to lmdb which uses this) |
20:34:06 | FromGitter | <Araq> https://eklausmeier.wordpress.com/2016/02/03/performance-comparison-mmap-versus-read-versus-fread/ |
20:34:24 | FromGitter | <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:59 | FromGitter | <tim-st> lol |
20:35:17 | FromGitter | <tim-st> but seems that it got very good marketing |
20:36:37 | FromGitter | <Araq> ripgrep doesn't use mmap. the author tried and it was slower. |
20:36:47 | FromGitter | <Araq> (at the end of my linked article) |
20:36:50 | FromGitter | <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:56 | FromGitter | <rayman22201> depends on the use case |
20:37:00 | FromGitter | <Araq> yup. |
20:40:28 | FromGitter | <rayman22201> mmap is very good for databases, but that is a very different use case to parsing / grepping |
20:45:32 | krux02 | PMunch, are you there? |
20:45:39 | PMunch | Yup |
20:45:50 | krux02 | I wrote an alternative to your optOr macro |
20:45:54 | krux02 | have you seen it? |
20:46:04 | PMunch | Uhm no, but I've since rewritten the entire thing |
20:46:08 | PMunch | With lot's of neat stuff |
20:46:27 | krux02 | https://github.com/nim-lang/Nim/pull/8369 |
20:46:28 | PMunch | .?, a pattern matcher, and combinatorial operators |
20:46:37 | PMunch | Commenting up everything now :) |
20:47:10 | krux02 | I have test cases :P |
20:47:16 | PMunch | Me to :) |
20:47:40 | PMunch | Just to give you a sneak peek: http://ix.io/1hLT |
20:48:39 | FromGitter | <Quelklef> @krux02 what's the purpose of `let xx = x`? |
20:48:40 | krux02 | https://github.com/krux02/Nim/blob/5e07428abb7024ca9eada3c5ae054e2157ebd312/lib/pure/options.nim#L344 |
20:48:48 | FromGitter | <Quelklef> Oh, nevermind |
20:48:50 | FromGitter | <Quelklef> for side effects |
20:49:11 | PMunch | Yeah |
20:52:17 | krux02 | PMunch in your check "Is hundred" |
20:52:29 | krux02 | normally pattern matching goes from to to bottom picking the first match |
20:52:41 | krux02 | that is how it is done in Haskell and how it is done in Scala |
20:52:44 | PMunch | Well this wraps everything in a case |
20:53:02 | krux02 | so some x: would already match the 100 |
20:53:07 | krux02 | to my intuituon |
20:53:10 | * | miran quit (Ping timeout: 245 seconds) |
20:53:18 | krux02 | that is also how ``ast-pattern-matching`` works |
20:53:50 | PMunch | Basically the matcher get's turned into an if x.isSome: case x.value: <bodies> else: <body without arguments>; else: none() |
20:54:24 | PMunch | Well 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:30 | PMunch | With zero code-duplication |
20:55:13 | PMunch | It would probably be more natural to your regular Nim programmer |
20:56:37 | krux02 | I also don't really like the ``some _ of 100`` notation. |
20:56:49 | krux02 | I would prefer if you could leave out the pattern matching |
20:57:04 | krux02 | for the operators, you seem to be pretty similar to what I have written |
20:57:50 | krux02 | pattern 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:04 | PMunch | Well, this is just a convenient wrapper around an if check and a case statement |
20:59:20 | PMunch | All the actual matching is done in the case statement |
20:59:37 | krux02 | still, it would consume that name "match" for the option type |
21:00:02 | PMunch | Well, as always I'm cool with changing the name |
21:01:03 | krux02 | I would really prefer if you could split that PR into the logical operators, and the pattern matching. |
21:01:37 | krux02 | I would like to use the word `match` for the general pattern matching. |
21:01:54 | FromGitter | <Araq> oh and one more thing, `mmap` doesn't support async IO. |
21:02:50 | krux02 | Araq: that conversation is quite some time ago? Or is there a bridge broken on IRC? |
21:03:09 | krux02 | but 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:23 | krux02 | when there is a chache miss the thread is blocked. |
21:04:02 | krux02 | but I would recommend to put everything that works on a bottleneck on a separate thread anyway |
21:04:28 | krux02 | noe thread processes the blocking IO and when it is done it signals this to the main thread somehow |
21:04:41 | krux02 | then it is async |
21:06:29 | * | yglukhov[i] joined #nim |
21:07:45 | krux02 | PMunch: can you do this: check((genNone() and 1 or 2) == 2) where genNone() returns an option[string]? |
21:09:11 | PMunch | Ah no, I forgot to have them accept different types |
21:09:48 | krux02 | and ``genNone() or "mystring"`` |
21:10:05 | * | UxerUospr quit (Quit: Lost terminal) |
21:10:55 | FromGitter | <tim-st> are default values for objects planned? |
21:11:25 | FromGitter | <tim-st> I mean like `a=1` instead of `a: int` |
21:11:36 | krux02 | tim-st: the default value is zero initialized memory |
21:11:44 | FromGitter | <tim-st> yes |
21:11:51 | PMunch | krux02, yeah both of those now work |
21:11:58 | krux02 | cool |
21:12:00 | PMunch | Assuming genNone returns a none :) |
21:12:05 | krux02 | can you take over my test cases pleas? |
21:12:09 | krux02 | yes |
21:12:49 | krux02 | or at least use my test cases and try if they work with your implementation |
21:13:11 | krux02 | I hope you implemented `or` and `and` with templates and not with macros |
21:14:18 | krux02 | tim-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:38 | FromGitter | <tim-st> ok, thanks |
21:15:11 | krux02 | it is also a nice property to know that "var myvar: MyType" is always a black object with no information in it. |
21:15:17 | FromGitter | <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:03 | FromGitter | <tim-st> yes, but sometimes it's quite useful, I now have a case where I want it to be `a = -1` |
21:16:54 | krux02 | well you can make that case 1 indexed so that a 0 means nothing |
21:17:30 | FromGitter | <tim-st> I dont know what you mean, it's an int |
21:17:41 | krux02 | what does that int mean? |
21:17:48 | krux02 | what does it count? |
21:18:01 | FromGitter | <tim-st> -1 == the length of the number is not yet found out |
21:18:35 | krux02 | what about option[int]? |
21:18:44 | krux02 | that one is default initialized to none |
21:19:03 | FromGitter | <tim-st> I hate this option[T] things I dont "feel" what this is, so I dont use it |
21:19:07 | krux02 | but it uses twice the memory of an int |
21:19:26 | FromGitter | <tim-st> hah, that's the downside I really that it has |
21:19:28 | krux02 | well it is not yet fully developed. |
21:19:31 | FromGitter | <tim-st> *thought |
21:19:36 | krux02 | so I get when you don't want to use it |
21:19:42 | krux02 | I feel similar |
21:20:06 | krux02 | but the idea of an option type is that you stop abusing special values as "I actually don't have a value" |
21:20:14 | FromGitter | <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:41 | krux02 | I also want a clean syntax |
21:20:49 | krux02 | and option is not yet clean |
21:21:03 | FromGitter | <Quelklef> krux02, what do you think of `T?` rather than `Option[T]`? |
21:21:23 | krux02 | Quelklef: in what context? |
21:21:32 | krux02 | for the name? |
21:21:35 | FromGitter | <tim-st> he means the question mark |
21:21:54 | krux02 | ah yea |
21:21:59 | krux02 | I don't know |
21:22:07 | krux02 | I agree that Option[T] is too verbose |
21:22:18 | krux02 | but T? is too short for my personal taste |
21:22:26 | FromGitter | <tim-st> I think the complete type isnt natural |
21:22:50 | FromGitter | <tim-st> when in mathmatics lessons you learnt about option[T]. |
21:22:52 | FromGitter | <tim-st> ? |
21:22:54 | FromGitter | <tim-st> I didnt |
21:22:55 | krux02 | but nim doesn't have a postfix operator |
21:23:06 | krux02 | (except the * for exporting symbols) |
21:23:22 | krux02 | so you woul need to make it a prefix operator |
21:23:28 | krux02 | ? T |
21:24:15 | krux02 | template `?`[T](_: typedesc[T]): untyped = Option[T] |
21:24:27 | * | cspar quit (Ping timeout: 240 seconds) |
21:25:19 | krux02 | I think I would be ok with a shorter name `Opt[t]` |
21:25:38 | krux02 | Option should be used often, and therefore shouldn't be so verbose. |
21:25:54 | krux02 | or maybe just Op[T] |
21:26:17 | krux02 | or as a builtin prefix like ptr or ref |
21:26:24 | * | cspar joined #nim |
21:26:32 | FromGitter | <tim-st> I have to ask again about streams: when I do setPosition(index) does it have a bad performance? |
21:26:53 | krux02 | pro 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:30 | krux02 | tim-st: I don't know, but is `setPosition` even universally allowed? |
21:27:45 | krux02 | I am thinking about processing stdin |
21:27:51 | krux02 | and stdout |
21:28:14 | krux02 | but maybe we talk about something entirely different. |
21:28:16 | FromGitter | <tim-st> I mean only on files |
21:28:47 | krux02 | my suggestion is, test it, becaues I don't know |
21:28:51 | FromGitter | <tim-st> https://nim-lang.org/docs/streams.html#setPosition,Stream,int |
21:29:01 | krux02 | but jumping around arbitrarily in memory is never free |
21:29:12 | FromGitter | <tim-st> ok, thanks |
21:29:21 | krux02 | even if the memory is already in ram, they you will still have a chache miss. |
21:29:30 | krux02 | so try to avoid jumping as much as possible |
21:32:00 | FromGitter | <Quelklef> @krux02 make it a special rule when parsing, which either then becomes `postfix(T, !"?")` or `bracketExpr(!"Option", T)` in the AST |
21:32:16 | FromGitter | <Quelklef> And disallow the `?` operator |
21:33:13 | FromGitter | <Quelklef> Actually, come to think of it, doing it prefix like `?T` would be nice |
21:33:23 | FromGitter | <Quelklef> Because it can just be implemented as a macro then |
21:33:27 | FromGitter | <Quelklef> I may even do that in my own code |
21:33:38 | FromGitter | <Quelklef> Also it wouldn't require special parsing |
21:33:51 | FromGitter | <Quelklef> But it's not quite as visually appealing as `T?` imo |
21:34:32 | krux02 | it can be implemented as a template and I posted the code up there |
21:34:48 | FromGitter | <Quelklef> Was that part of your PR? |
21:34:51 | FromGitter | <Quelklef> Didn't see it, my bad |
21:34:53 | krux02 | no |
21:34:56 | FromGitter | <Quelklef> oh |
21:35:03 | krux02 | template `?`[T](_: typedesc[T]): untyped = Option[T] |
21:35:08 | krux02 | it was here in the chat |
21:35:10 | FromGitter | <Quelklef> yeah |
21:35:14 | FromGitter | <Quelklef> ok |
21:35:15 | FromGitter | <Quelklef> mb |
21:35:16 | krux02 | ````template `?`[T](_: typedesc[T]): untyped = Option[T]```` |
21:35:20 | FromGitter | <Quelklef> ah i see |
21:35:23 | krux02 | maybethat is better to see |
21:35:33 | krux02 | not tested though |
21:35:49 | FromGitter | <Quelklef> Why the single arg? |
21:36:22 | FromGitter | <Quelklef> not just ``template `?`[T: typedesc]: untyped = Option[T]`` |
21:36:38 | FromGitter | <Quelklef> Wait, not just ``template `?`[T]: untyped = Option[T]`` |
21:36:50 | krux02 | well try what works best |
21:36:57 | krux02 | to my experience the single arg works best |
21:37:20 | FromGitter | <Quelklef> ...does it not require an argument, though? |
21:37:30 | FromGitter | <Quelklef> Or does `_` do something special as a parameter |
21:37:33 | Demos[m] | tried rust again. I like nim better :<> |
21:37:45 | FromGitter | <Quelklef> : } |
21:37:58 | dom96 | :(){}<> |
21:38:11 | krux02 | the `_` 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:25 | FromGitter | <Quelklef> In the body |
21:38:28 | FromGitter | <Quelklef> But |
21:38:47 | FromGitter | <Quelklef> Ah, I get it now |
21:39:01 | krux02 | good :) |
21:39:05 | FromGitter | <Quelklef> because `?int` is `` `?`(int) ``, not `` `?`[int] `` |
21:39:14 | krux02 | yes |
21:39:29 | dom96 | Demos[m]: Now write a blog post :D |
21:39:45 | krux02 | you would need to write `` ?[int]() `` |
21:40:01 | FromGitter | <Quelklef> I think it can be done with no `()`? But yeah |
21:40:20 | krux02 | with just generic parameters? I don't think so |
21:41:11 | krux02 | I think the design of `typedesc` is a bit broken |
21:41:13 | FromGitter | <Quelklef> !eval template x[T] = T; echo(seqx[int (1, 2, 3)) |
21:41:14 | NimBot | Compile failed: in.nim(1, 34) Error: ']' expected |
21:41:27 | FromGitter | <Quelklef> oh no |
21:41:29 | FromGitter | <Quelklef> the formatting again |
21:42:37 | krux02 | !eval template x[T] = T; echo(seq[x int](1, 2, 3)) |
21:42:39 | NimBot | <no output> |
21:43:22 | FromGitter | <Quelklef> Curiously, it fails on my machine |
21:43:37 | krux02 | what fails? |
21:43:40 | FromGitter | <Quelklef> Wait, I'm doing something else |
21:43:58 | FromGitter | <Quelklef> Which also isn't related to the question |
21:44:04 | FromGitter | <Quelklef> hold on |
21:44:12 | FromGitter | <Quelklef> !eval template x[n] = 2; echo(x[4]) |
21:44:14 | NimBot | <no output> |
21:44:25 | FromGitter | <Quelklef> hmmm |
21:45:05 | FromGitter | <Quelklef> Something's fucky |
21:45:30 | FromGitter | <Quelklef> ok, here, this works: |
21:45:42 | FromGitter | <Quelklef> ```template x[t] = ⏎ echo "neat" ⏎ x[int]``` ⏎ ⏎ outputs "neat" [https://gitter.im/nim-lang/Nim?at=5b510686c579673e6b80ad31] |
21:47:03 | FromGitter | <krux02> interesting |
21:47:08 | FromGitter | <krux02> got: <string> ⏎ but expected: <T> |
21:47:14 | FromGitter | <krux02> that is a bug in Nim |
21:47:24 | FromGitter | <krux02> because of the broken `typedesc` thing |
21:47:39 | FromGitter | <Quelklef> For the `?` template? |
21:47:45 | FromGitter | <krux02> how is "expected: <T>" an error |
21:47:46 | FromGitter | <krux02> yes |
21:47:51 | FromGitter | <Quelklef> Hmm |
21:48:14 | FromGitter | <krux02> the typedesc thing needs to die in the Nim language |
21:48:37 | FromGitter | <Quelklef> I got the same error |
21:48:39 | FromGitter | <Quelklef> Why |
21:48:40 | FromGitter | <Quelklef> ? |
21:49:23 | FromGitter | <Quelklef> Also, just do ``template `?`(T: untyped): untyped = Option[T]``. It's as type-safe. |
21:50:10 | krux02 | yes that might be true |
21:50:42 | FromGitter | <Quelklef> It is, given that T has no constraints and is only the type for one variable |
21:50:52 | krux02 | yes |
21:50:58 | krux02 | I am just used to my pattern that is all |
21:51:07 | krux02 | I use many overloads |
21:51:51 | krux02 | template sometypeprop(_: typedesc[MyType]): string = "mypropfrommytype" |
21:53:25 | * | chopzwei quit (Ping timeout: 250 seconds) |
22:08:07 | PMunch | Hmm, this is troublesome.. |
22:08:22 | PMunch | >= is rewritten as not <= |
22:08:36 | PMunch | Which means that the logic I need for options completely breaks down.. |
22:10:37 | PMunch | Araq, why doesn't Nim handle overrides for >= and != ? |
22:11:00 | PMunch | I get that it's easier to implement one operations instead of both, but for this stuff I really need both.. |
22:13:07 | FromGitter | <Quelklef> PMuch, I think it's more than that |
22:13:32 | PMunch | How so? |
22:13:40 | FromGitter | <Quelklef> In essence, I think the idea is also: if you need to define more than `<` and `!=`, you're doing it wrong |
22:13:55 | FromGitter | <Quelklef> Because comparison operators should implement a natural (?) ordering |
22:14:07 | PMunch | Well, they do in this case.. |
22:14:12 | FromGitter | <Quelklef> Which is sufficiently specified by `<` and `!=` |
22:14:16 | FromGitter | <Quelklef> Wait, why do you need both, then? |
22:14:39 | FromGitter | <Quelklef> If it's a n ordering, then `>=` should be equiv to `not <=`, right? |
22:14:48 | PMunch | They return their first option when the condition is true |
22:15:01 | PMunch | So some(100) >= some(42) return some(100) |
22:15:12 | FromGitter | <Quelklef> Don't use `>=` then |
22:15:13 | FromGitter | <Quelklef> imo |
22:15:52 | PMunch | Why? It makes perfect sense.. |
22:16:06 | PMunch | I guess I could add some obscure >=? things.. |
22:16:11 | PMunch | But that would look a bit messy.. |
22:16:31 | PMunch | Would make it more obvious though what is going on |
22:20:28 | FromGitter | <Quelklef> Because I expect `>=` to return a boolean |
22:20:51 | FromGitter | <Quelklef> suddenly `if some(100) >= some(42): echo("")` doesn't work |
22:21:09 | FromGitter | <Quelklef> Because a comparison operator doesn't return a boolean |
22:22:34 | PMunch | Sorry, my keyboard ran out of battery -_- |
22:22:39 | FromGitter | <Quelklef> np |
22:22:59 | PMunch | That actually does work as options implicitly converts to their has-ity when used as booleans |
22:23:36 | PMunch | some some(100) >= some(42) returns some(100) which has a value (a true has-ity) and returns true |
22:24:48 | FromGitter | <Quelklef> !eval import options; if some(1): echo("huh") |
22:24:49 | NimBot | Compile failed: in.nim(1, 24) Error: type mismatch: got <Option[system.int]> but expected 'bool' |
22:24:52 | FromGitter | <Quelklef> Hm |
22:25:01 | FromGitter | <Quelklef> Apparently |
22:25:04 | FromGitter | <Quelklef> Apparently not* |
22:25:09 | PMunch | yet* |
22:25:09 | FromGitter | <Quelklef> Also I'll BRB gonna pick up food |
22:25:20 | PMunch | I'm working on a PR for the options module |
22:25:26 | PMunch | Which adds a lot of neat stuff :) |
22:25:36 | PMunch | Really fleshes out the concpet |
22:25:39 | PMunch | concept* |
22:28:45 | * | skrylar joined #nim |
22:35:34 | skrylar | is the soap-pocalypse still happening? |
22:41:02 | * | icebattle quit (Quit: leaving) |
22:52:01 | FromDiscord | <awr> what is the "soap-pocalypse" |
22:54:29 | * | cspar quit (Ping timeout: 260 seconds) |
23:04:13 | PMunch | krux02, just updated my PR https://github.com/nim-lang/Nim/pull/8358 |
23:04:25 | PMunch | It's pretty neat! |
23:04:34 | PMunch | But 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:37 | FromGitter | <citycide> PMunch: you're out by now but it seems odd to me that `==` returns an Option.. is that a thing elsewhere? |