00:13:49 | disruptek | sets in bed, nothing like it. |
00:14:12 | disruptek | i've gotten so used to sets outside, i don't even know if i'd be able to perform in bed. |
00:15:40 | alehander92 | noo |
00:16:28 | FromDiscord | <Avatarfighter> anddd thats enough disruptek for me today |
00:17:11 | disruptek | wut |
00:17:27 | disruptek | group theory is far more interesting one your hands and knees. |
00:17:44 | disruptek | c'mon fighter. |
00:17:48 | disruptek | you know what i'm talkin' about. |
00:19:42 | FromDiscord | <Avatarfighter> ahahah |
00:20:13 | FromDiscord | <Avatarfighter> I think I might've fucked up making the main drive of my laptop a microsd card |
00:20:25 | FromDiscord | <Avatarfighter> it has an unfortunate habit of corrupting itsel |
00:21:30 | disruptek | see, you can't blame me for /all/ corruption. |
00:21:46 | * | abm quit (Read error: Connection reset by peer) |
00:23:52 | FromDiscord | <Avatarfighter> lmao |
00:27:17 | disruptek | keep your fingers crossed for me. |
00:28:02 | alehander92 | survive |
00:28:04 | alehander92 | oh man |
00:29:01 | disruptek | thing is, arraymancer works for me. i don't get it. |
00:29:24 | disruptek | it works on #head and it works on v0.6.0. |
00:34:02 | FromDiscord | <Avatarfighter> Just curious, does anyone know the best way to add/remove from hosts file programmatically? |
00:34:22 | disruptek | the best way? |
00:34:39 | FromDiscord | <Avatarfighter> how about the most practical |
00:35:17 | disruptek | eh.. echo "foo # stupid" >> /etc/hosts; grep -v "foo # stupid" /etc/hosts |
00:35:31 | FromDiscord | <Avatarfighter> hm ok |
00:35:37 | FromDiscord | <Avatarfighter> time to make that a nim library >:) |
00:35:39 | disruptek | where stupid is, i dunno, `echo foo | sum`. |
00:36:08 | FromDiscord | <Avatarfighter> i would like to mitm a specific ip but only when my program is running |
00:36:44 | FromDiscord | <Avatarfighter> so the plan is to change the hosts file and have the specific ip point to my program so that the game client remains untouched |
00:37:22 | disruptek | i guess it's not the worst idea i've heard tonight. |
00:37:58 | FromDiscord | <Avatarfighter> yeah |
00:38:42 | FromDiscord | <Avatarfighter> i wanted to transparently proxy the connection but im not good enough at programming for that |
00:39:32 | disruptek | why would you need to do that? |
00:40:03 | disruptek | another way would be to inject your own lookup routine. |
00:40:15 | disruptek | or run your own dns server with a lua script or something. |
00:41:17 | FromDiscord | <Avatarfighter> well the idea is that while my program is running I can modify the packets flying between the client and the server and while the program isn't running it keeps running normally. Ultimately I'd like it to all be self contained in the exe |
00:43:27 | disruptek | well, you can preload a lib when you launch the game. |
00:46:25 | FromDiscord | <Avatarfighter> yeah i realize i can probably just inject |
00:46:33 | FromDiscord | <Avatarfighter> that was kind of dumb of me to assume otherwise |
00:46:49 | FromDiscord | <Avatarfighter> what ever 😛 we'll see lol |
01:26:32 | FromDiscord | <Elegant Beef> So i have a template that takes a enum and a proc, how can i write it such that i can just attach it to a proc and not have to call it? |
01:26:47 | disruptek | what? |
01:26:51 | FromDiscord | <Elegant Beef> Template signature https://play.nim-lang.org/#ix=2x8T |
01:27:04 | FromDiscord | <Elegant Beef> I want to use it as a pragma |
01:27:23 | FromDiscord | <Elegant Beef> it complains about illformed AST when i attach it |
01:28:13 | FromDiscord | <Rika> That's not how a template as pragma's signature would look like isn't it |
01:28:22 | FromDiscord | <Elegant Beef> I dont think so i think it needs to be untyped |
01:28:23 | disruptek | why is it even a template? |
01:28:43 | FromDiscord | <Elegant Beef> I mean it can just be a compiletime proc, but it's a moot point |
01:28:52 | disruptek | why is it even that? |
01:29:01 | FromDiscord | <Elegant Beef> What do you mean? |
01:29:34 | disruptek | somearray[entType] = someproc |
01:29:37 | disruptek | right? |
01:29:39 | FromDiscord | <Elegant Beef> Yea |
01:29:59 | disruptek | why are you making this more complex? |
01:30:23 | FromDiscord | <Elegant Beef> Why not? |
01:30:39 | disruptek | because you don't get any extra points for confusing people. |
01:30:43 | disruptek | believe me, i've tried. |
01:30:47 | FromDiscord | <Rika> Why would you need a template for that |
01:30:57 | FromDiscord | <Elegant Beef> You dont |
01:31:01 | FromDiscord | <Rika> Sorry, I don't think |
01:31:06 | disruptek | we know. |
01:31:24 | FromDiscord | <Rika> I'm surprised you're capable of knowing |
01:31:24 | FromDiscord | <Elegant Beef> I wanted to attach it to a proc body, to subscribe the proc to a lut |
01:31:33 | disruptek | a lut? |
01:31:38 | FromDiscord | <Elegant Beef> lookuptable |
01:32:47 | disruptek | i think what you want is like, `proc foo(...) {.lookup: [EntityType.A].}` -- right? |
01:32:52 | FromDiscord | <Elegant Beef> yea |
01:32:58 | disruptek | well, so do that. |
01:33:17 | FromDiscord | <Elegant Beef> I was asking how |
01:33:42 | disruptek | make a macro lookup that sets the proc symbol into the lut. |
01:33:48 | * | Tanger joined #nim |
01:33:58 | disruptek | it has to be typed, of course. |
01:34:39 | disruptek | i don't really know why you'd want this, though. |
01:35:15 | FromDiscord | <Elegant Beef> Is there a better way to annotate that the proc is or a specific enum in a lut? |
01:35:38 | disruptek | better how? |
01:36:03 | FromDiscord | <Elegant Beef> More acceptable in your eyes |
01:36:26 | disruptek | i don't really know why some people want anal beads, but their acceptability in my eyes isn't what's important, right? |
01:36:56 | disruptek | compTimeArray[SomeType] = someProc |
01:40:34 | disruptek | do you want to talk about the beads? |
01:40:51 | disruptek | or would you rather i ranted about simplification? |
01:41:04 | disruptek | you have this array. it's compile-time, sure. |
01:41:15 | disruptek | it encapsulates everything you need to know about the data. |
01:41:25 | disruptek | how do i know this? because it's what you're using. |
01:41:37 | disruptek | you know what's nice about an array versus a pragma macro? |
01:41:44 | disruptek | programmers know how to program with it. |
01:41:47 | * | apahl quit (Ping timeout: 260 seconds) |
01:41:51 | disruptek | they know how to enumerate its contents. |
01:41:57 | disruptek | they know all sorts of things they can do with it. |
01:42:02 | disruptek | indexing stuff. |
01:42:09 | disruptek | writing macros against it. other procs. |
01:42:13 | disruptek | passing it to procs they already have. |
01:42:17 | disruptek | copying it around in memory. |
01:42:25 | disruptek | it's a fucking miracle, that little array. |
01:42:33 | disruptek | and now you want to take that miracle away from me. |
01:42:50 | FromDiscord | <Elegant Beef> I mean this is just for a game and a method of abstracting the entity init procs to an entity type |
01:43:04 | disruptek | I WILL FIND YOU. |
01:43:08 | FromDiscord | <Elegant Beef> So there isnt really any reason to do anything but set the array index to the proc |
01:43:18 | * | apahl joined #nim |
01:48:48 | * | femtotones quit (Ping timeout: 260 seconds) |
01:50:47 | disruptek | if ever there is, what would you do? |
01:51:04 | disruptek | you'd just create a `[]=`() for the array, right? |
01:51:59 | FromDiscord | <Elegant Beef> idk what you mean, if there was a quick and easy method to attach a pragma to the proc to subscribe it to the array, without having to dick around with macros i'd have done it |
01:52:29 | disruptek | there is. it's called `system.[]=`() and it's fucking brilliant. |
01:52:51 | FromDiscord | <Elegant Beef> "attach a pragma to the proc to subscribe it" |
01:54:27 | FromDiscord | <Elegant Beef> Dont worry disruptek i'm just using the array as an array |
02:03:32 | Prestige | oh wow, netty looks cool |
02:06:25 | * | endragor joined #nim |
02:12:08 | FromDiscord | <Elegant Beef> It is |
02:12:24 | FromDiscord | <Elegant Beef> I toyed around with it to make an RPC system |
02:19:11 | FromDiscord | <Theodore> Imagine using IRC |
02:19:26 | FromDiscord | <Elegant Beef> You dont need to you can just do it |
02:25:12 | Prestige | Fucking love irc |
02:40:37 | disruptek | he really does love irc. |
02:49:27 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:51:32 | * | muffindrake joined #nim |
02:53:11 | * | NimBot joined #nim |
03:35:39 | * | vicfred quit (Quit: Leaving) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:32 | * | supakeen joined #nim |
04:31:54 | * | drewr joined #nim |
04:55:17 | * | vicfred joined #nim |
04:59:15 | FromDiscord | <Avatarfighter> disruptek go to bed |
05:16:38 | * | narimiran joined #nim |
05:54:03 | * | leorize quit (Ping timeout: 240 seconds) |
05:56:53 | * | leorize joined #nim |
06:00:11 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:08:17 | * | solitudesf joined #nim |
06:27:19 | * | PMunch joined #nim |
06:47:15 | * | a_chou quit (Quit: a_chou) |
06:56:24 | * | PMunch quit (Quit: leaving) |
06:56:40 | * | PMunch joined #nim |
06:57:02 | PMunch | Hmm, is pakku not maintained any longer? |
07:03:12 | FromDiscord | <Elegant Beef> I mean this isnt really reassuring "Say hello to stillborn AUR helper written in stillborn programming language!" |
07:03:29 | FromDiscord | <Elegant Beef> It's not archived and was update 5 months ago |
07:04:01 | PMunch | Yeah I just realised that there is a PR in for it |
07:04:27 | PMunch | Not great though.. |
07:05:16 | PMunch | I'm guessing @kitsunyan isn't too active here? |
07:09:03 | FromDiscord | <Elegant Beef> They arent a discord member |
07:10:42 | PMunch | Hmm, maybe I should go through the rigamarole of taking over their AUR package and make a fork out of it on GitHub.. |
07:21:02 | FromDiscord | <Elegant Beef> You do you, im still just waiting for your VM |
07:21:20 | FromGitter | <alehander92> PMunch what vm |
07:21:33 | PMunch | WM |
07:21:43 | FromDiscord | <Elegant Beef> His window manager, it's a joke cause of how he was pronouncing it on his stream |
07:21:49 | PMunch | -_- |
07:22:22 | * | krux02 joined #nim |
07:22:26 | FromDiscord | <Elegant Beef> Reason #300091 why pmunch doesnt want me to talk to him |
07:22:32 | PMunch | Maybe I should call it PimoVM just as a joke :P |
07:22:41 | FromGitter | <alehander92> ohh ahaha |
07:22:52 | PMunch | Ey, I don't have anything against you talking to me! |
07:23:59 | * | Sgeo quit (Read error: Connection reset by peer) |
07:26:06 | FromDiscord | <Elegant Beef> Now you reading my responses is where you have issue 😛 |
07:27:10 | PMunch | Haha :P |
07:47:57 | FromDiscord | <lqdev> vindow manager™️ |
07:49:22 | * | vicfred quit (Quit: Leaving) |
07:52:14 | PMunch | Wirtual Machine |
07:53:03 | FromDiscord | <Elegant Beef> I have a VM running in KWM |
07:59:41 | FromDiscord | <Recruit_main707> whats the recommended way of writing object fields:↵`position*: Vector3` or↵`position* : Vector3` |
07:59:58 | PMunch | `position*: Vector3` |
08:00:19 | FromDiscord | <Recruit_main707> ok, its just that ive seen a lot of people using the other way |
08:00:52 | PMunch | Yeah, lots of weird styles out there |
08:01:37 | FromDiscord | <Elegant Beef> I wasa one that did the latter |
08:01:42 | FromDiscord | <Rika> ~~Wector3~~ |
08:01:47 | FromDiscord | <Elegant Beef> (edit) 'wasa' => 'was' |
08:02:27 | PMunch | Guess it should be mentioned in the NEP-1: https://nim-lang.org/docs/nep1.html |
08:03:00 | PMunch | I should just set up an IRC client plug-in that changes all my Ws to Vs.. |
08:03:27 | FromDiscord | <Elegant Beef> Lol, confuse the fuck out of anyone out of loop "Is he writting with a russian accent?" |
08:03:35 | FromGitter | <alehander92> that would be wery good |
08:03:39 | PMunch | Haha :P |
08:04:43 | alehander92 | my accent is very strong on interviews |
08:05:01 | alehander92 | i wonder if people are getting the right impressions |
08:06:15 | Zevv | You should hear my standup these days |
08:06:17 | Zevv | its hilarious |
08:06:38 | alehander92 | plug us in |
08:06:45 | alehander92 | Zeww |
08:07:01 | alehander92 | btw man i wanted to ask |
08:07:12 | alehander92 | does anyone maintain some helpers for drawing graphs in the compiler |
08:07:26 | FromDiscord | <Elegant Beef> Zevv no one ever laughs at my standup so i resort to sit down, its the same jokes but with even fewer laughs |
08:07:32 | alehander92 | i want to write one simple but i wondered if we have something more reusable |
08:07:41 | alehander92 | as there are many graphs there |
08:07:44 | * | gmaggior joined #nim |
08:07:56 | Tanger | hey folks, I'm looking to implement the GeoJSON spec (https://tools.ietf.org/html/rfc7946), which essentially involves casting JSON to a few different types. One thing I'll need is heterogeneous sequences with different types in. Would this be a job for object variants or object inheritance? |
08:08:21 | Tanger | The plan was to just cast geoJSON to objects using `to` from the json lib |
08:08:50 | alehander92 | this is not casting! |
08:08:52 | Tanger | Buuut, I don't think that'll work with object variants, as in the spec, different objects have different types for a shared property name |
08:09:23 | alehander92 | cast usually preseerves the runtime value, `to` converts it |
08:10:15 | alehander92 | so `a: A` and `a: B` ? |
08:11:02 | Zevv | "drawing graphs in the compiler"? |
08:11:15 | Tanger | Ah, my bad alehander92 |
08:11:22 | Tanger | Poorly chosen terminology |
08:11:40 | alehander92 | zevv i mean printing representations of them |
08:12:47 | FromDiscord | <Ricky Spanish> @shashlick i tried again using nimterop again and didnt actually even need to do anywork to nimterop to get it working with vcc for the onnxruntime - literally just added the vcc flag to getcompiler and it worked and seems to be fully functional somehow, atleast for my use-case |
08:12:52 | euantorano | Looks like the 1.2.6 package is broken on OpenBSD :( https://builds.sr.ht/~euantorano/job/299484 - seems it's still using `gcc` rather than `clang` |
08:14:48 | euantorano | It looks like `config/nim.cfg` isn't backported, which is a shame. I'll have to build from Git instead |
08:18:00 | * | AndChat|21441 joined #nim |
08:19:16 | PMunch | Zevv, I think he means like you're doing for npeg |
08:19:31 | alehander92 | i didn't think of it |
08:19:38 | alehander92 | but sounds good? |
08:20:01 | * | gmaggior quit (Ping timeout: 264 seconds) |
08:22:47 | alehander92 | wow those are good |
08:22:54 | alehander92 | well i didn't really want dot graphs tho |
08:23:00 | alehander92 | just ascii stuff |
08:23:20 | alehander92 | but i'll write something simple for this usecase only |
08:23:28 | Zevv | Interestingly, the ascii graph building in npeg is *very* similar to the IR building |
08:23:34 | Zevv | it's recursively putting boxes in boxes |
08:23:38 | Zevv | that would probably work for AST as well |
08:25:30 | alehander92 | hmm |
08:25:42 | alehander92 | the diagrams ? |
08:25:55 | alehander92 | i am really imagining something simpler |
08:26:05 | alehander92 | e.g. `{a} ---18:5---> {b}` |
08:27:19 | alehander92 | maybe `edge("{a}", "{b}", vertexText="18:5")` |
08:27:47 | * | krux02_ joined #nim |
08:30:07 | * | krux02 quit (Ping timeout: 260 seconds) |
08:35:46 | * | gmaggior joined #nim |
08:37:27 | * | AndChat|21441 quit (Ping timeout: 258 seconds) |
08:41:40 | * | Tanger quit (Ping timeout: 258 seconds) |
08:46:02 | * | AndChat|21441 joined #nim |
08:47:05 | * | gmaggior quit (Ping timeout: 240 seconds) |
08:47:05 | FromGitter | <ynfle> Are any of the standard types implemented as objects? Like strings and seqs? |
08:47:55 | alehander92 | yes! |
08:48:23 | alehander92 | strings and seqs are |
08:50:20 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:52:03 | alehander92 | Araq i .. kinda wonder about the hash stuff in general |
08:52:25 | alehander92 | do people take `kind` of variant objects into account? because otherwise you get `a.b` == `a[b]` |
08:52:32 | alehander92 | or at least something like that |
08:53:19 | * | Vladar joined #nim |
08:58:15 | * | gmaggior joined #nim |
08:59:46 | * | AndChat|21441 quit (Ping timeout: 256 seconds) |
09:00:37 | Araq | alehander92, usually I don't hash trees |
09:01:04 | Araq | but we do hash the kind, result = ord(n.kind) |
09:01:08 | alehander92 | yeah so i need to just `!&` the kinds |
09:01:15 | alehander92 | ah hm |
09:01:30 | alehander92 | ok so this should be fine |
09:05:13 | * | awe00 joined #nim |
09:14:31 | * | AndChat|21441 joined #nim |
09:16:11 | * | gmaggior quit (Ping timeout: 240 seconds) |
09:25:35 | * | gmaggior joined #nim |
09:26:13 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2xaH |
09:26:53 | FromDiscord | <Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaH' => 'https://play.nim-lang.org/#ix=2xaI' |
09:27:28 | * | AndChat|21441 quit (Ping timeout: 256 seconds) |
09:27:37 | FromDiscord | <Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaI' => 'https://play.nim-lang.org/#ix=2xaJ' |
09:27:52 | FromDiscord | <Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaJ' => 'https://play.nim-lang.org/#ix=2xaK' |
09:28:07 | FromDiscord | <Ricky Spanish> (edit) 'https://play.nim-lang.org/#ix=2xaK' => 'https://play.nim-lang.org/#ix=2xaL' |
09:28:13 | * | FromDiscord quit (Remote host closed the connection) |
09:28:28 | * | FromDiscord joined #nim |
09:30:22 | * | superbia quit (Ping timeout: 256 seconds) |
09:31:18 | * | superbia joined #nim |
09:32:38 | alehander92 | wow minitel was an interesting piece of tech |
09:32:47 | alehander92 | mratsim have you used it |
09:37:09 | Zevv | I did. It was called 'viditel' here |
09:37:53 | * | AndChat|21441 joined #nim |
09:39:26 | * | gmaggior quit (Ping timeout: 256 seconds) |
09:42:42 | * | gmaggior joined #nim |
09:43:36 | FromDiscord | <lqdev> @Ricky Spanish the struct is incomplete because it doesn't have a definition in the header file, only a declaration |
09:44:10 | FromDiscord | <lqdev> this means that the struct is created by the wrapped library, so one of the library's functions probably returns an opaque pointer to it |
09:44:28 | * | AndChat|21441 quit (Ping timeout: 256 seconds) |
09:46:28 | * | abm joined #nim |
09:53:55 | FromDiscord | <Ricky Spanish> yeh that is the problem, OrtApi works because its declared in the header but ortEnv seems to be the result of a inout function, but its weird in their sample they directly use a raw pointer ``` OrtEnv* env;``` where the only include is the header im wrapping so iv no idea where they are getting the type defintion for that from, anyway thanks @lqdev |
10:00:49 | * | awe00 quit (Ping timeout: 246 seconds) |
10:01:01 | * | dddddd_ is now known as dddddd |
10:01:40 | * | awe00 joined #nim |
10:11:01 | * | abm quit (Ping timeout: 264 seconds) |
10:11:04 | * | zyklon quit (*.net *.split) |
10:11:04 | * | einichi quit (*.net *.split) |
10:11:05 | * | LyndsySimon quit (*.net *.split) |
10:11:05 | * | d10n-work quit (*.net *.split) |
10:11:05 | * | blackbeard420 quit (*.net *.split) |
10:11:05 | * | npgm_ quit (*.net *.split) |
10:11:05 | * | dom96 quit (*.net *.split) |
10:11:05 | * | dgb quit (*.net *.split) |
10:11:23 | * | dgb joined #nim |
10:12:03 | * | blackbeard420 joined #nim |
10:12:07 | * | d10n-work joined #nim |
10:12:21 | * | dom96 joined #nim |
10:12:22 | * | dom96 quit (Changing host) |
10:12:22 | * | dom96 joined #nim |
10:13:25 | * | Cthalupa quit (Ping timeout: 246 seconds) |
10:16:16 | * | Cthalupa joined #nim |
10:16:59 | * | einichi joined #nim |
10:16:59 | * | npgm_ joined #nim |
10:16:59 | * | LyndsySimon joined #nim |
10:17:00 | * | npgm_ quit (Changing host) |
10:17:00 | * | npgm_ joined #nim |
10:17:02 | * | AndChat|21441 joined #nim |
10:17:04 | * | einichi quit (Changing host) |
10:17:04 | * | einichi joined #nim |
10:18:38 | * | gmaggior quit (Ping timeout: 260 seconds) |
10:28:56 | * | letto quit (Quit: Konversation terminated!) |
10:31:56 | * | letto joined #nim |
10:37:17 | * | gmaggior joined #nim |
10:38:45 | * | AndChat|21441 quit (Ping timeout: 240 seconds) |
10:41:51 | * | arecacea1 quit (Remote host closed the connection) |
10:42:43 | * | arecacea1 joined #nim |
11:11:32 | * | AndChat|21441 joined #nim |
11:13:16 | * | gmaggior quit (Ping timeout: 246 seconds) |
11:16:10 | * | newUser joined #nim |
11:16:40 | newUser | hi, how can I check if a file is open or closed? |
11:23:02 | * | gmaggior joined #nim |
11:24:07 | * | AndChat|21441 quit (Ping timeout: 246 seconds) |
11:28:38 | * | AndChat|21441 joined #nim |
11:29:52 | * | gmaggior quit (Ping timeout: 256 seconds) |
11:35:56 | * | gmaggior joined #nim |
11:37:23 | newUser | how can I check if a file is open or closed? |
11:37:48 | * | AndChat|21441 quit (Ping timeout: 256 seconds) |
11:38:21 | * | abm joined #nim |
11:41:39 | * | AndChat|21441 joined #nim |
11:42:35 | * | gmaggior quit (Ping timeout: 240 seconds) |
11:50:37 | * | newUser quit (Remote host closed the connection) |
11:51:09 | * | pietroppeter joined #nim |
11:57:11 | FromDiscord | <Ricky Spanish> which level do you mean at? in your program i presume nim uses fopen or something of the sort so should be presumed to be open until youre done with it, at the os level youd probably have to deal with polling or something to see what programs are using it |
11:58:47 | FromDiscord | <Ricky Spanish> i.e like lsof on linux |
12:04:39 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2xbD |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:32 | * | supakeen joined #nim |
12:11:43 | * | krux02_ quit (Read error: Connection reset by peer) |
12:12:36 | * | krux02_ joined #nim |
12:18:13 | * | awe00 quit (Ping timeout: 260 seconds) |
12:24:35 | * | awe00 joined #nim |
12:26:41 | Araq | newUser: write the code in a way that you know it's been opened. worked for every program I ever wrote. |
12:35:34 | * | gmaggior joined #nim |
12:35:52 | alehander92 | Araq |
12:36:01 | alehander92 | do you dislike distinct int-s / seq-s a lot? |
12:36:23 | alehander92 | i wanted to use GraphId / VarId instead of int-s for the seq-s/handles in the graph |
12:36:46 | alehander92 | but i can just use `GraphId = int` instead of distinct is being viewed as too much |
12:37:07 | * | AndChat|21441 quit (Ping timeout: 240 seconds) |
12:42:43 | Araq | distinct ints are fine, distinct seqs are shit |
12:43:16 | * | AndChat|21441 joined #nim |
12:43:22 | Araq | but maybe I change my mind if I see your solution |
12:44:27 | * | gmaggior quit (Ping timeout: 240 seconds) |
12:47:29 | alehander92 | ok, i'll show it later |
12:53:29 | * | lritter joined #nim |
12:56:09 | FromDiscord | <shashlick> @Ricky Spanish that's pretty cool, maybe there's gcc flag support or something |
12:56:29 | FromDiscord | <dk> Out of curiosity - is there any reason to assign a new seq instead of calling `setLen 0`? |
12:57:48 | PMunch | Not sure if seqs will ever shrink their internal buffer |
12:58:10 | PMunch | So with setLen 0 you won't have the possibility to free the memory of the seqs buffer |
12:58:16 | PMunch | But that's the only reason I can think of |
12:58:27 | FromDiscord | <dk> Right |
12:58:57 | PMunch | But that really only applies if you've got a freakishly massive buffer.. |
13:00:02 | FromDiscord | <lqdev> you're essentially avoiding unnecessary allocations |
13:07:24 | FromDiscord | <dk> Nim doesn't release memory to the OS immediately so I don't think it matters |
13:07:57 | FromDiscord | <lqdev> yeah but setLen will reuse the currently allocated data store |
13:08:08 | FromDiscord | <lqdev> while x = @[] will allocate a new one |
13:08:35 | FromDiscord | <lqdev> really it's just a microoptimization since nim's allocator is O(1) iirc |
13:10:02 | FromDiscord | <Recruit_main707> i know you can do comparisons on concepts, but im not sure why this throws an error, basically saying there is no `not` function for type bool.↵https://play.nim-lang.org/#ix=2xbU |
13:10:32 | FromDiscord | <Recruit_main707> `Non-matching candidates for not (this.form == None)` |
13:10:46 | FromDiscord | <Recruit_main707> running the code will output the whole message |
13:10:51 | alehander92 | umm |
13:10:54 | alehander92 | how can it know that |
13:11:26 | alehander92 | the value of `form` ? eventually something like that might be possible with enum flow-based constraints |
13:11:33 | alehander92 | but i doubt this can work now |
13:15:14 | * | agent0x00 joined #nim |
13:16:05 | FromDiscord | <Recruit_main707> sent a long message, see http://ix.io/2xbZ |
13:17:29 | alehander92 | hm, maybe |
13:18:05 | alehander92 | i think the enum thing would be cool tho but .. should showcase it one day |
13:18:08 | alehander92 | bbl |
13:18:56 | FromDiscord | <Recruit_main707> this is a bit dirtier, but a bit more practical i think |
13:22:26 | Araq | lqdev: Nim's allocator is O(1) but it can make a big difference in practice, not so much for arc though |
13:23:54 | FromDiscord | <haxscramper> I wrote RFC for implicit initialization hooks - https://github.com/nim-lang/RFCs/issues/252 - mostly it just summarizes previous ones, but I'm interested in comments on the general idea / proposed implementation. |
13:23:56 | disbot | ➥ User-defined implicit initialization ; snippet at 12https://play.nim-lang.org/#ix=2xc2 |
13:25:33 | FromDiscord | <lqdev> Araq: wdym in practice? |
13:26:27 | Araq | I mean that triggering Nim's GC run can be expensive, there is more to a GC than just an O(1) allocator |
13:27:25 | Araq | so here is a riddle |
13:27:33 | Araq | the code is roughly: |
13:28:01 | Araq | objects = traverse(graph) |
13:28:09 | Araq | for o in objects: free(o) |
13:28:50 | Araq | and valgrind says 'traverse' accesses an object that's been freed |
13:29:10 | Araq | but since we free them all *after* traverse that's logically impossible |
13:29:26 | Araq | unless these two lines would run in a loop |
13:30:53 | Araq | and the code does run frequently but in the end the graph is emptied |
13:31:52 | PMunch | Hmm, well this is a weird bug.. |
13:33:27 | PMunch | I created a request object which I then send a pointer to over a channel. This request object has a fulfilled boolean that the receiver sets to true after it has filled in all the correct information in the memory location of the request. The sending threads then busy loop on this boolean until it's true. |
13:33:56 | PMunch | For some reason this just seemed to hang, so I echoed out the request during every iteration, and all of a sudden it works |
13:34:47 | Araq | yeah, you're better off with a global bool flag |
13:34:52 | Araq | atomic operations and polling |
13:34:58 | PMunch | I wonder if this is just Nim or C optimising away the check for a variable that can't change (without taking into consideration the sending thread) and just outputting a "while true: discard" or something |
13:35:17 | PMunch | Well I can't have a global bool |
13:35:42 | PMunch | Basically the main thread is going to be a cache handler which will keep an up to date record of some data |
13:35:56 | Araq | it's usually a more subtle timing issue (data race?), rarely an optimizer thing but who knows |
13:36:07 | PMunch | When another thread needs this data it sends a request and needs to get a reply |
13:36:28 | FromGitter | <ynfle> Is there an easy way to insert commas in to `int`s for printing? |
13:36:57 | PMunch | But the sending thread doesn't write anything, and the reading thread is the only writer |
13:37:06 | PMunch | So a data race shouldn't happen.. |
13:37:15 | Araq | there is strutils.insertSep but don't do that, commas are American style, others prefer dots |
13:38:09 | FromDiscord | <lqdev> maybe insert _ or ' |
13:38:24 | FromDiscord | <lqdev> _ nim-style and ' calculator LCD style |
13:41:06 | PMunch | It works even if I just do discard $request in my loop |
13:42:20 | PMunch | Hmm, it works as long as I echo anything.. |
13:42:53 | PMunch | Might actually be timing, sleep(1) also works.. |
13:45:13 | PMunch | Works if I switch the reading of the boolean to atomic operations |
13:45:20 | PMunch | Might've been some strange caching behaviour.. |
13:50:06 | FromGitter | <ynfle> Thanks @Araq |
13:50:33 | FromDiscord | <mbenam> Good morning all. How do we see the documentation of the package nimpdf? I looked in the pkgs folder. Didn't see anything. |
13:53:01 | PMunch | You need to build the documentation yourself |
13:53:22 | FromDiscord | <mbenam> Any guidance please? |
13:55:43 | PMunch | Oh wait, it's not documented the way I thought.. |
13:57:02 | PMunch | Hmm, I could've sworn I had read some documentation for it |
13:57:11 | PMunch | But I might've just looked at the examples and the docs.txt file |
13:57:52 | FromDiscord | <mbenam> It says in the git to use docutils |
14:00:15 | PMunch | I guess you could try |
14:01:27 | FromDiscord | <mbenam> I am trying to convert existing pdf pages to jpgs. Without looking at the documentation, not sure if this package will help. I will do some digging how to use docutils. |
14:01:52 | PMunch | Ah, I don't think it will |
14:02:02 | PMunch | This is for creating PDFs IIRC |
14:02:25 | FromDiscord | <mbenam> Yes, I was afraid of the same thing. |
14:02:40 | FromDiscord | <mbenam> Any other package that you can think of? |
14:03:50 | PMunch | Not really, I'd probably just use inkscape or something like pdftoppm |
14:04:15 | PMunch | Or imagemagick |
14:05:07 | disruptek | !repo imagemagick |
14:05:08 | disbot | https://github.com/zedeus/nimagemagick -- 9nimagemagick: 11ImageMagick wrapper for Nim (MagickCore/MagickWand) 15 5⭐ 1🍴 |
14:05:11 | FromDiscord | <mbenam> I am aware of those. Just didn't want to install all these mega apps for this |
14:05:37 | PMunch | Imagemagick takes 10Mb on my machine.. |
14:05:39 | PMunch | Not exactly mega |
14:06:05 | PMunch | About 1/20th of what VSCode takes |
14:06:14 | FromDiscord | <mbenam> I will look into that. |
14:06:53 | FromDiscord | <mbenam> I was trying to get a small self contained package that I could give to my other team members. |
14:07:45 | alehander92 | Araq ok |
14:08:13 | alehander92 | another thing i see is .. the pointer analysis just gives you a final group of sets right |
14:08:38 | disruptek | dude, it's too early in the morning for group sets. |
14:08:40 | alehander92 | but this is not great |
14:08:46 | alehander92 | oi disruptek! |
14:09:01 | alehander92 | as a = b; a = A() can mean |
14:09:28 | alehander92 | i mean |
14:09:31 | alehander92 | it would be wrong |
14:09:36 | alehander92 | at one of the lines |
14:09:59 | alehander92 | either {a} {b} (but its {a, b} on 1) or {a, b} (but its {a} {b} on 2) |
14:10:49 | alehander92 | so one just needs sets for each step (so basically to build them parallelly to the flow traversal) |
14:14:12 | * | Kaivo quit (Ping timeout: 256 seconds) |
14:16:10 | * | Kaivo joined #nim |
14:18:20 | disruptek | Araq: is concepts ready for testing? |
14:20:18 | alehander92 | huh and in both cases: too liberal and too conservative alias sets, it seems one can have a bug on theory |
14:20:32 | FromDiscord | <lqdev> PMunch: that's deep underestimation. vscode takes about 1600Mb |
14:20:52 | FromDiscord | <lqdev> 10Mb*20 = 200Mb |
14:21:34 | alehander92 | too liberal can wrongly see a, b as aliased and permit deref b based on a check |
14:22:02 | superbia | Total Installed Size: 77.09 MiB |
14:22:22 | alehander92 | too conservative can wrongly see a, b as not aliased and permit deref b.field after b check ; mutation a.field |
14:22:51 | alehander92 | so it's like one just needs correct sets at each point |
14:24:38 | alehander92 | ok this is not a problem: one can just not permit stuff for aliased, but only warn (and require checks otherwise) |
14:24:49 | alehander92 | so this means more liberal is better |
14:25:51 | FromDiscord | <lqdev> superbia: i checked with `du -h /usr/share/vscodium-bin` and it says `216M` which i rounded off to 200MiB. which is about 1600Mb |
14:26:19 | FromDiscord | <lqdev> unless you're talking about imagemagick, didn't check that one |
14:27:28 | superbia | i have the open source versionen then, hence less megs |
14:29:14 | alehander92 | so in this case we can use the final alias set but it wouldn't be very precise |
14:29:19 | alehander92 | so it might have more false positives |
14:31:52 | FromDiscord | <mbenam> decided to install poppler library on windows finally and use pdftocairo. Total install size 17mb. |
14:37:11 | * | vicfred joined #nim |
14:40:12 | * | gmaggior joined #nim |
14:41:25 | * | narimiran quit (Ping timeout: 240 seconds) |
14:41:31 | * | AndChat|21441 quit (Ping timeout: 246 seconds) |
14:44:14 | * | superbia1 joined #nim |
14:46:06 | * | superbia quit (Disconnected by services) |
14:46:08 | * | superbia1 is now known as superbia |
14:55:20 | * | AndChat|21441 joined #nim |
14:55:36 | FromDiscord | <LiteLotus> just double checking, continue in a while loop skips this iteration of the while loop and goes to the next one right? |
14:55:48 | FromDiscord | <lqdev> kind of |
14:56:08 | FromDiscord | <lqdev> every loop has an implicit `block` in it |
14:56:15 | FromDiscord | <lqdev> and `continue` simply `break`s that block |
14:56:30 | FromDiscord | <LiteLotus> oh ok |
14:56:35 | * | gmaggior quit (Ping timeout: 240 seconds) |
14:56:39 | FromDiscord | <lqdev> so it does skip the iteration yes |
14:56:40 | FromDiscord | <LiteLotus> but does it break out of the loop? |
14:56:46 | FromDiscord | <lqdev> no |
14:56:50 | FromDiscord | <LiteLotus> ok good |
14:57:15 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2xcq |
14:57:21 | FromDiscord | <lqdev> so the effect is the same |
14:57:28 | FromDiscord | <LiteLotus> nice ok |
14:57:31 | FromDiscord | <dk> the block should be outside |
14:58:03 | FromDiscord | <lqdev> no |
14:58:05 | FromDiscord | <LiteLotus> not if you dont want to break out of the loop |
14:58:06 | FromDiscord | <lqdev> it's _inside_ |
14:58:14 | FromDiscord | <dk> nvm, delet |
14:58:25 | FromDiscord | <lqdev> https://nim-lang.org/docs/manual.html#statements-and-expressions-continue-statement |
14:58:31 | FromDiscord | <LiteLotus> thanks |
15:02:59 | * | gmaggior joined #nim |
15:04:07 | * | AndChat|21441 quit (Ping timeout: 240 seconds) |
15:07:43 | FromDiscord | <LiteLotus> sent a code paste, see https://play.nim-lang.org/#ix=2xcE |
15:08:03 | FromDiscord | <LiteLotus> (edit) 'https://play.nim-lang.org/#ix=2xcE' => 'https://play.nim-lang.org/#ix=2xcF' |
15:08:28 | FromDiscord | <lqdev> nim-lang.org/docs/strformat.html |
15:08:31 | FromDiscord | <lqdev> (edit) 'nim-lang.org/docs/strformat.html' => 'https://nim-lang.org/docs/strformat.html' |
15:08:40 | FromDiscord | <lqdev> it's even better |
15:08:50 | FromDiscord | <lqdev> since you can embed expressions directly in strings |
15:08:54 | FromDiscord | <LiteLotus> it looks like a version of regexp |
15:09:05 | FromDiscord | <LiteLotus> i saw it but dont see how it does what i want |
15:09:15 | FromDiscord | <lqdev> otherwise you have https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D |
15:09:57 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2xcH |
15:10:05 | FromDiscord | <LiteLotus> fuf |
15:10:08 | FromDiscord | <LiteLotus> (edit) 'fuf' => 'huh' |
15:10:13 | FromDiscord | <LiteLotus> yeah that is better |
15:10:44 | FromDiscord | <LiteLotus> why is an example like that not in the docuimentation? |
15:10:56 | FromDiscord | <lqdev> there is. |
15:11:05 | FromDiscord | <lqdev> literally at the top of the page |
15:11:05 | FromDiscord | <LiteLotus> not in str format |
15:11:12 | FromDiscord | <lqdev> in this section https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp |
15:11:15 | FromDiscord | <lqdev> the first code example. |
15:11:30 | FromDiscord | <LiteLotus> oh |
15:11:36 | FromDiscord | <LiteLotus> hes doing it with a do assert |
15:11:36 | FromDiscord | <LiteLotus> why |
15:11:37 | FromDiscord | <lqdev> but i guess it's not really worded well |
15:11:49 | FromDiscord | <LiteLotus> i thought it was some form of regex testing |
15:12:13 | FromDiscord | <lqdev> because doAssert asserts that an expression is true. if it's not, it raises an exception |
15:12:23 | FromDiscord | <LiteLotus> but this isnt live code |
15:12:30 | FromDiscord | <LiteLotus> i cant see if its raising anyghint |
15:12:34 | FromDiscord | <lqdev> contrary to regular `assert`, `doAssert` works also in release mode |
15:12:35 | FromDiscord | <LiteLotus> i mean i guess it isnt |
15:12:50 | FromDiscord | <lqdev> you can be sure it doesn't raise because all examples in the documentation are checked |
15:13:09 | FromDiscord | <LiteLotus> yeah but thats not what im reading when i see this in documentation |
15:13:23 | FromDiscord | <LiteLotus> what im seing is a test not someone saying this wequals this |
15:13:43 | FromDiscord | <lqdev> i don't get what you mean. |
15:13:48 | FromDiscord | <LiteLotus> no documentation does that anywhere |
15:14:09 | FromDiscord | <LiteLotus> no documentation that i have ever read says that 1 ==1 with some form of test function |
15:14:42 | FromDiscord | <lqdev> really? |
15:14:46 | FromDiscord | <LiteLotus> yeah |
15:14:52 | FromDiscord | <LiteLotus> read the C# documentation |
15:14:57 | FromDiscord | <lqdev> well nim docs have that all around |
15:14:59 | FromDiscord | <LiteLotus> or any of the TS / JS documentation |
15:15:08 | FromDiscord | <LiteLotus> or any Python documentation |
15:15:11 | FromDiscord | <lqdev> it's a form of explaining how something works, but with actual code examples |
15:15:24 | FromDiscord | <lqdev> cppreference.com also has examples like those |
15:15:35 | FromDiscord | <LiteLotus> i guess its a cpp thing |
15:15:47 | FromDiscord | <LiteLotus> or low level language thing |
15:16:26 | FromDiscord | <LiteLotus> but in c#, js /ts, and python documentation they will give you the code snippet and then show you what it equals |
15:16:37 | FromDiscord | <LiteLotus> but they wont relate the too with a test function |
15:16:42 | FromDiscord | <LiteLotus> (edit) 'too' => 'two' |
15:16:47 | FromDiscord | <LiteLotus> im not a compiler |
15:16:57 | FromDiscord | <LiteLotus> im a human reading text |
15:17:00 | FromDiscord | <lqdev> um |
15:17:05 | FromDiscord | <lqdev> but the meaning of `doAssert` is clear |
15:17:08 | FromDiscord | <lqdev> it's an assertion |
15:17:33 | FromDiscord | <lqdev> by reading the example you know that a proc/macro/iterator/whatever works that way |
15:17:59 | FromDiscord | <lqdev> haven't you seen an assertion before? |
15:18:01 | FromDiscord | <LiteLotus> i mean sure, but there is doing things one way because you want to and there is doing it another because its widely used and easy to read |
15:18:11 | FromDiscord | <LiteLotus> not in documentation |
15:18:22 | FromDiscord | <LiteLotus> when writing tests sure |
15:18:26 | FromDiscord | <LiteLotus> never in documentation |
15:18:35 | FromDiscord | <lqdev> it's not just because you want to, the documentation also serves as a test suite this way while simultaneously being human-readable |
15:18:51 | FromDiscord | <lqdev> show me a concrete example how other docs solve this problem. |
15:19:14 | FromDiscord | <LiteLotus> https://www.typescriptlang.org/docs/handbook/basic-types.html |
15:19:23 | disruptek | i'm not a fan of doAssert, either. |
15:19:35 | FromDiscord | <lqdev> but that's a handbook, not the reference documentation. |
15:19:51 | FromDiscord | <LiteLotus> it serves as reference if you go through the examples |
15:20:04 | disruptek | litelotus: the reason those docs aren't something to aspire to is that they don't convey meaning. |
15:20:09 | FromDiscord | <LiteLotus> https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html |
15:20:17 | disruptek | assertions are literally truths. |
15:20:34 | disruptek | simply assigning a value doesn't impart any semantics to the user's comprehension. |
15:20:49 | disruptek | this is why unittests use assertion-like constructs and not mere assignments. |
15:20:59 | FromDiscord | <LiteLotus> i mean it does if we are talking about a strong typed language |
15:21:08 | FromDiscord | <LiteLotus> because i know what something does or doesnot equal |
15:21:15 | FromDiscord | <LiteLotus> pretty simple |
15:21:27 | FromDiscord | <LiteLotus> i would agree if it was a soft typed language like python |
15:21:27 | disruptek | this concept of preconceived knowledge misses the point. |
15:21:39 | disruptek | we're trying to convey the semantics of the types. |
15:21:42 | disruptek | assertions show that. |
15:21:54 | FromDiscord | <lqdev> assertions are runtime, not compile-time |
15:21:56 | disruptek | you don't find words used to define themselves in the dictionary. |
15:22:00 | * | endragor quit (Remote host closed the connection) |
15:22:08 | FromDiscord | <lqdev> so by using an assertion you're checking the actual value, not the type. |
15:22:33 | * | endragor joined #nim |
15:22:33 | FromDiscord | <LiteLotus> but logic would dictate that if you understand the type you would know if they are or are not equal |
15:22:50 | disruptek | if you understand the type, you don't need the String section in the docs you linked. |
15:22:54 | FromDiscord | <LiteLotus> if you dont you dont understand the type and ned to read up on it |
15:23:07 | disruptek | then without running this documentation, i cannot determine what it does. |
15:23:13 | disruptek | that's not great. |
15:23:18 | disruptek | in fact, it's piss-poor. |
15:23:40 | FromDiscord | <LiteLotus> then why is that easier to understand than the nim documentation |
15:23:56 | disruptek | i would say it's not. |
15:24:02 | FromDiscord | <vieru> sent a long message, see http://ix.io/2xcM |
15:24:13 | disruptek | look, they literally say "you can do this thing..." and this is equivalent to "this other thing". |
15:24:18 | disruptek | that's basically an assertion. |
15:24:26 | disruptek | they would do well to take a hint from nim's docs. |
15:24:51 | disruptek | our docs aren't just unambiguous, they are literally code that is compiled and run during the documentation process. |
15:25:02 | disruptek | the benefit of this should be obvious. |
15:25:19 | FromDiscord | <LiteLotus> its not immediately human readable |
15:25:35 | FromDiscord | <lqdev> no, it _is_. |
15:25:38 | FromDiscord | <LiteLotus> at least to me comming from a higher level language like C# |
15:25:39 | FromDiscord | <lqdev> you just have to know the language. |
15:25:44 | disruptek | i guess you need to make friends with a human. |
15:25:48 | FromDiscord | <lqdev> the _basics_ of the language. |
15:25:56 | * | arecacea1 quit (Remote host closed the connection) |
15:26:02 | FromDiscord | <LiteLotus> i guess i dont then |
15:26:08 | disruptek | https://disruptek.github.io/gram/gram.html |
15:26:19 | * | arecacea1 joined #nim |
15:26:41 | FromDiscord | <LiteLotus> because assert seems like a silly way to tell me that "this" == "this" |
15:27:00 | disruptek | what would you prefer? |
15:27:03 | FromDiscord | <LiteLotus> just remove the do assert |
15:27:11 | FromDiscord | <LiteLotus> it would immediately make more sense |
15:27:17 | FromDiscord | <lqdev> then you're literally discarding the result of the expression goddamnit |
15:27:21 | FromDiscord | <lqdev> and literally ignoring the test |
15:27:28 | FromDiscord | <lqdev> doAssert makes sure that the expression is true |
15:27:32 | disruptek | lqdev: this might be a lost cause. |
15:27:33 | FromDiscord | <lqdev> is that really that hard to understand? |
15:27:43 | FromDiscord | <LiteLotus> nvm |
15:27:51 | FromDiscord | <LiteLotus> look thi sis going in circles |
15:27:52 | * | endragor quit (Ping timeout: 256 seconds) |
15:28:16 | FromDiscord | <LiteLotus> all im saying is as someone that writes webcode for a living this documentation is hard to read |
15:28:21 | FromDiscord | <LiteLotus> thats it |
15:28:29 | FromDiscord | <lqdev> i mean, it seemed pretty obvious to _me_ how this works. not sure what's hard to understand here |
15:28:34 | FromDiscord | <lqdev> assertions are common across many languages |
15:28:40 | FromDiscord | <LiteLotus> not everyone reads the same tho |
15:28:41 | FromDiscord | <vieru> just prepend the documentation with "doAssert does this" |
15:28:57 | FromDiscord | <vieru> and all people are happy |
15:28:58 | FromDiscord | <LiteLotus> that would work |
15:29:20 | FromDiscord | <LiteLotus> any statement following doAssert is true |
15:29:42 | FromDiscord | <lqdev> i mean, it's not like system docs are hidden or something |
15:29:52 | FromDiscord | <lqdev> you can cross-reference that pretty easily |
15:30:01 | FromDiscord | <LiteLotus> i dont want to have to go down a rabit hole of pages to find out if i can format a string |
15:30:05 | disruptek | i'm not a fan of doAssert, but you'd be surprised just how many people have opened tickets saying "the use of assert in the docs is confusing." |
15:30:43 | FromDiscord | <LiteLotus> i dont want to spend time in the doc pages when i could be coding |
15:30:53 | FromDiscord | <vieru> wasn't that hard figuring it out tbh |
15:30:57 | FromDiscord | <LiteLotus> make something simple to understand and quick to navigate to so i can get back to coding |
15:31:09 | disruptek | probably best to code without understanding. |
15:31:28 | FromDiscord | <LiteLotus> i dont know if i can agree there |
15:31:35 | FromDiscord | <LiteLotus> i want to understand |
15:31:39 | FromDiscord | <LiteLotus> but i learn by doing |
15:31:41 | disruptek | otherwise you're just going to spend years pursuing a career you're not suited for. |
15:31:51 | FromDiscord | <vieru> lol |
15:32:00 | FromDiscord | <vieru> roasted and toasted i guess |
15:32:14 | FromDiscord | <LiteLotus> i mean im already a programmer |
15:32:23 | FromDiscord | <LiteLotus> its already my career bub |
15:32:37 | FromDiscord | <vieru> sksk |
15:32:56 | FromDiscord | <LiteLotus> im learning nim for fun |
15:33:06 | disruptek | well, are you hiring? |
15:33:25 | disruptek | i am looking to go pro and i rarely let understanding stand in the way of coding. |
15:33:41 | FromDiscord | <vieru> sent a long message, see http://ix.io/2xcQ |
15:34:16 | FromDiscord | <LiteLotus> i never said understanding got in my way of coding, i just said i learn by doing it rather than reading it |
15:34:29 | FromDiscord | <LiteLotus> so make it quick so i can do it |
15:34:47 | FromDiscord | <LiteLotus> and at least get a surface understanding of whetever im trying to do |
15:34:48 | disruptek | vieru: sure, you want them automagically applied? |
15:34:56 | FromDiscord | <vieru> yep |
15:35:14 | disruptek | !repo nim-strenc |
15:35:15 | disbot | https://github.com/Yardanico/nim-strenc -- 9nim-strenc: 11A tiny library to automatically encrypt string literals in Nim code 15 12⭐ 1🍴 |
15:35:32 | disruptek | that should be a good demo. |
15:36:41 | disruptek | litelotus: you've come to the wrong place. #nim is about understanding. you need to download an editor. |
15:36:59 | FromDiscord | <LiteLotus> ........... |
15:37:12 | FromDiscord | <LiteLotus> i have an editor |
15:37:16 | FromDiscord | <LiteLotus> what do you take me for? |
15:37:34 | disruptek | best that i don't answer that. |
15:37:35 | FromDiscord | <LiteLotus> this is going from instructional to insulting |
15:37:48 | FromDiscord | <LiteLotus> no i think you should |
15:37:54 | FromDiscord | <LiteLotus> i want to see your true colours |
15:38:01 | disruptek | it's embarrassing. |
15:38:09 | FromDiscord | <LiteLotus> say it |
15:38:28 | FromDiscord | <vieru> > !repo nim-strenc↵i can't really figure out how this works lol↵↵`gkkaekgaEE` this might be my g function right ? |
15:38:37 | disruptek | yeah. |
15:38:45 | * | hnOsmium0001 joined #nim |
15:39:42 | FromDiscord | <vieru> sent a code paste, see https://play.nim-lang.org/#ix=2xcT |
15:40:01 | disruptek | would you mind not pasting code? |
15:40:08 | disruptek | it's a huge pita for irc people to read it. |
15:40:28 | FromDiscord | <vieru> oh sry |
15:40:33 | disruptek | i mean, just paste it without code formatting so i don't have to open a web-browser just to see what you've said. 😉 |
15:40:51 | FromDiscord | <vieru> i dont use irc |
15:40:58 | FromDiscord | <vieru> its line 26-27 |
15:40:59 | FromDiscord | <vieru> https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim |
15:41:03 | FromDiscord | <LiteLotus> its a boomer thing |
15:41:05 | disruptek | the encrypt macro is rewriting the string literals. |
15:41:12 | * | a_chou joined #nim |
15:41:34 | FromDiscord | <vieru> and what's doing the decryption ? |
15:41:49 | FromDiscord | <vieru> (edit) 'decryption' => 'decryption/decoding' |
15:42:02 | FromDiscord | <LiteLotus> hashes im guessing |
15:42:31 | disruptek | the proc gkkaekgaEE is decrypting it. |
15:43:42 | disruptek | the macro emits something like `gkkasdlfkasldf("garbage here", somekeyInteger)` |
15:44:05 | disruptek | so the "garbage here" is the literal that goes into your code. |
15:44:12 | disruptek | er, into your binary. |
15:44:30 | disruptek | the code decrypts it on the fly. |
15:45:21 | FromDiscord | <vieru> sry for the dumb questions but what's the proc that encrypts ? |
15:45:24 | FromDiscord | <vieru> is it the macro ? |
15:45:39 | disruptek | the encryption is the first line of the macro. |
15:45:56 | disruptek | the macro is applying to all string literals automatically due to term rewriting. |
15:46:24 | FromDiscord | <vieru> ooh so gkkaekgaEE is used for both decryption and encryption ? |
15:46:29 | disruptek | right. |
15:46:43 | FromDiscord | <vieru> that was the thing confusing me |
15:47:50 | disruptek | that line is compile-time while the macro's result, code of course, is runtime. |
15:48:47 | FromDiscord | <vieru> sent a long message, see http://ix.io/2xcZ |
15:48:47 | * | maier quit (Ping timeout: 240 seconds) |
15:48:55 | disruptek | ... |
15:49:12 | disruptek | yes. |
15:49:17 | FromDiscord | <vieru> sry again lol |
15:49:45 | FromDiscord | <vieru> thanks |
15:50:10 | disruptek | is that kinda what you're trying to do? |
15:50:19 | FromDiscord | <vieru> yep |
15:50:34 | disruptek | cool. |
15:51:02 | FromDiscord | <vieru> im messing with the idea of polymorphism and im trying out things |
15:51:35 | * | NimBot joined #nim |
15:52:15 | disruptek | term-rewriting macros are in danger of being redesigned. |
15:52:53 | FromDiscord | <vieru> why so ? |
15:53:20 | disruptek | i dunno what araq's goals are for them, but i think they are arguably too powerful. |
15:53:48 | disruptek | they are practically magic. |
15:54:39 | FromDiscord | <vieru> this means in the future my code won't be able to do magic ↵or magic is nerfed |
15:54:57 | FromDiscord | <vieru> cus either way its bad |
15:55:10 | disruptek | i would seriously question why you need such magic. |
15:56:03 | FromDiscord | <vieru> hiding keys i guess ? |
15:56:25 | FromDiscord | <vieru> and if you have all that power |
15:56:31 | FromDiscord | <vieru> why not hide all the strings |
15:56:50 | FromDiscord | <LiteLotus> im getting a type mismatch when using strformat and i'm not sure why. i have followed the documentation almost exactly, the only difference being i have no end line character |
15:57:02 | FromDiscord | <LiteLotus> im using the & version |
15:57:07 | disruptek | ~paste |
15:57:07 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
15:57:23 | disruptek | vieru: because it's obfuscation. |
15:57:30 | disruptek | it's hard for others to service your code. |
15:57:32 | FromDiscord | <LiteLotus> i hsvent pasted it yet |
15:57:33 | * | abm quit (Read error: Connection reset by peer) |
15:57:36 | * | endragor joined #nim |
15:57:42 | disruptek | please do so. |
15:57:49 | FromDiscord | <LiteLotus> i was about to write an example |
15:57:54 | disruptek | or at least hold your laptop closer to the router so i can read the code. |
15:57:55 | FromDiscord | <LiteLotus> patience |
15:58:05 | FromDiscord | <LiteLotus> you know what |
15:58:10 | FromDiscord | <LiteLotus> fuck you ill solve it on my own |
15:58:14 | FromDiscord | <vieru> disruptek on a killing streak |
15:58:17 | FromDiscord | <vieru> lol |
15:58:49 | FromDiscord | <LiteLotus> what the fuck is with people, just becaue i either dont dev like you and dont do everything like you |
15:58:50 | FromDiscord | <vieru> > it's hard for others to service your code.↵idk what `service your code` means |
15:59:02 | FromDiscord | <LiteLotus> read it and help fix it |
15:59:09 | FromDiscord | <vieru> eng is not my first language |
15:59:10 | disruptek | it will be hard for you to understand what you've written after a few weeks/months. |
15:59:18 | disruptek | harder still for others to understand it. |
15:59:32 | disruptek | litelotus: have some humility. |
15:59:42 | FromDiscord | <LiteLotus> about what? |
15:59:51 | FromDiscord | <LiteLotus> im literally asking for help |
15:59:51 | disruptek | about learning. |
15:59:59 | FromDiscord | <LiteLotus> i dont know how much more humble i can get |
16:00:07 | FromDiscord | <LiteLotus> im litterally asking for help |
16:00:13 | FromDiscord | <LiteLotus> what more do you want? |
16:00:19 | FromDiscord | <LiteLotus> me to fucking bend over? |
16:00:23 | disruptek | an open mind, for a start. |
16:00:28 | FromDiscord | <LiteLotus> i do |
16:00:36 | FromDiscord | <LiteLotus> all i said was the documentation was hard ro read |
16:00:50 | FromDiscord | <LiteLotus> you yourself said a lot of people dont immediately understand it |
16:00:57 | disruptek | you are literally criticising the use of "assert" and suggesting that the docs should be simplified so that you can get to coding sooner. |
16:01:01 | FromDiscord | <LiteLotus> how is that a hard concept for you to grasp |
16:01:02 | disruptek | i was being sarcastic. |
16:01:31 | FromDiscord | <LiteLotus> jesus |
16:01:38 | FromDiscord | <LiteLotus> you really do have your head up tour own ass |
16:01:43 | FromDiscord | <vieru> > it will be hard for you to understand what you've written after a few weeks/months.↵oh i get it now |
16:01:50 | * | slackytude[m] quit (Quit: Idle for 30+ days) |
16:02:10 | disruptek | macros are inherently magical and hard to understand. term rewriting macros take this to another level. |
16:02:46 | FromDiscord | <vieru> well if term rewriting macros get removed ill just use a older nim version lol↵imma make my own nim2 and start propaganda |
16:02:50 | FromDiscord | <vieru> lol |
16:02:59 | disruptek | that's the spirit. 👍 |
16:03:18 | FromDiscord | <LiteLotus> your this much of a dick over me saying i didnt get the use of do assert in example documentation |
16:03:30 | FromDiscord | <LiteLotus> 👏 |
16:03:34 | disruptek | just ignore me. |
16:03:53 | FromDiscord | <vieru> dude chill that's how disruptek is ↵youll get used to him |
16:03:56 | FromDiscord | <vieru> lol |
16:04:04 | FromDiscord | <LiteLotus> nah man |
16:04:08 | FromDiscord | <vieru> its nothing personal |
16:04:24 | FromDiscord | <LiteLotus> its people like him that make newbies learning stuff turn away |
16:04:44 | FromDiscord | <LiteLotus> its the exavt same problem people had with araq |
16:04:54 | FromDiscord | <vieru> im a newbie and im laughing my ass of with disruptek |
16:04:57 | FromDiscord | <vieru> (edit) 'of' => 'off' |
16:05:24 | FromDiscord | <LiteLotus> well you two can be two dicks in a gay bar |
16:05:29 | FromDiscord | <LiteLotus> that fine |
16:05:36 | FromDiscord | <LiteLotus> im out |
16:05:44 | FromDiscord | <LiteLotus> :Peace: |
16:05:57 | FromDiscord | <vieru> see im not the one insulting you ↵you started with the gay shit lol |
16:06:04 | voidpi | the fuck with these oversensitive people? |
16:06:19 | FromDiscord | <vieru> exactly lol |
16:06:21 | FromDiscord | <LiteLotus> i was trying to be nice |
16:06:32 | FromDiscord | <LiteLotus> they started with the sarcastic shit |
16:06:51 | FromDiscord | <vieru> u fight sarcasm with sarcasm |
16:07:00 | FromDiscord | <LiteLotus> it wasnt called for |
16:07:04 | FromDiscord | <LiteLotus> at all |
16:07:31 | FromDiscord | <LiteLotus> i was asking a question |
16:07:37 | disruptek | you didn't realize it was sarcasm until i pointed it out. |
16:07:44 | FromDiscord | <LiteLotus> exactly |
16:07:46 | disruptek | so how exactly could you've been offended by it? |
16:07:56 | FromDiscord | <LiteLotus> because i was asking a question and trying to have a conversation |
16:07:59 | FromDiscord | <vieru> dude stop that's just the way he is ↵if you dont like him or anyone on the server just don't talk with them↵none is going to kick you out of the server |
16:08:15 | FromDiscord | <vieru> try asking at a different time |
16:08:17 | FromDiscord | <vieru> as |
16:08:26 | disruptek | try asking, period. |
16:08:33 | disruptek | i'm still waiting to hear what the problem is. |
16:08:35 | FromDiscord | <vieru> (edit) 'as' => 'answers aren't like stackoverflow questions' |
16:08:53 | FromDiscord | <vieru> you won't find them when you want |
16:09:03 | FromDiscord | <vieru> ask at different times |
16:09:10 | FromDiscord | <vieru> with different people |
16:09:14 | FromDiscord | <vieru> that's what everbody does |
16:09:19 | FromDiscord | <vieru> (edit) 'everbody' => 'everybody' |
16:09:48 | voidpi | black box! |
16:09:50 | FromDiscord | <vieru> > i'm still waiting to hear what the problem is.↵disruptek on that killing streak again lol |
16:10:01 | * | gmaggior quit (Quit: Bye) |
16:10:26 | FromDiscord | <vieru> tf im i doing im wasting my precious coding time |
16:11:00 | FromDiscord | <vieru> tryna solve internet arguments lol |
16:11:22 | FromDiscord | <vieru> (edit) 'tryna ... solve' => 'trynahelp' |
16:11:22 | disruptek | sounds like he figured it out. 🤷 |
16:11:43 | FromDiscord | <LiteLotus> https://play.nim-lang.org/#ix=2xdb |
16:12:25 | FromDiscord | <LiteLotus> https://play.nim-lang.org/#ix=2xdd corrected version |
16:12:25 | disruptek | https://play.nim-lang.org/#ix=2xde |
16:12:35 | * | endragor quit (Ping timeout: 240 seconds) |
16:12:44 | disruptek | the & operator comes from the strformat module. |
16:12:50 | FromDiscord | <mratsim> I'm not sure if people on IRC will see your deleted messages/edits correctly |
16:12:56 | disruptek | they do. |
16:13:00 | FromDiscord | <LiteLotus> it was imported on my ide |
16:13:08 | FromDiscord | <LiteLotus> didnt bother to include it because thats obvious |
16:13:20 | disruptek | it's not obvious to the playground. |
16:13:33 | FromDiscord | <LiteLotus> well im assuming you have a brain |
16:13:38 | disruptek | to those reading your code, it's a conspicuous omission. |
16:13:56 | FromDiscord | <vieru> > https://play.nim-lang.org/#ix=2xde↵fuck dude you're quick |
16:14:44 | disruptek | it was only two bugs. |
16:14:45 | FromDiscord | <LiteLotus> its a linter error |
16:15:00 | disruptek | there's no error afaict. |
16:15:09 | FromDiscord | <LiteLotus> looks like its just my linter that sees it as a type missmatch |
16:15:31 | disruptek | vim works well for me with leorize's nim.nvim package. |
16:15:33 | disruptek | !repo nim.nvim |
16:15:34 | FromDiscord | <LiteLotus> a linter error means that my linter isnt reading it properly |
16:15:34 | disbot | https://github.com/alaviss/nim.nvim -- 9nim.nvim: 11Nim plugin for NeoVim 15 95⭐ 13🍴 7& 3 more... |
16:15:52 | FromDiscord | <LiteLotus> ty |
16:16:03 | disruptek | np |
16:16:58 | FromDiscord | <vieru> enough to make a grown man cry https://media.discordapp.net/attachments/371759389889003532/754012619219664925/unknown.png |
16:17:14 | FromDiscord | <LiteLotus> im fine when your direct |
16:17:44 | FromDiscord | <vieru> type mismatch |
16:17:49 | FromDiscord | <vieru> word 4 |
16:17:56 | FromDiscord | <vieru> line 1 |
16:18:16 | FromDiscord | <vieru> did you mean "you're" ? |
16:18:24 | FromDiscord | <vieru> lol |
16:18:28 | FromDiscord | <LiteLotus> yeah i did |
16:18:46 | FromDiscord | <LiteLotus> though wouldnt that be unrecognised symbol? |
16:19:03 | FromDiscord | <ache of head> “Your” is a word, so I guess not |
16:19:06 | FromDiscord | <vieru> nah sry we don't do that |
16:19:07 | FromDiscord | <ache of head> If it said skdjwiwnsiddnwja |
16:19:16 | FromDiscord | <ache of head> That would be an unrecognized symbol 😆 |
16:19:28 | FromDiscord | <vieru> @LiteLotus fix your eng linter lol |
16:19:43 | FromDiscord | <LiteLotus> it was born defective, im dyslexic |
16:19:51 | FromDiscord | <vieru> thats cap |
16:20:11 | FromDiscord | <vieru> dyslexic people cant write dyslexic |
16:20:17 | FromDiscord | <vieru> even i struggle lol |
16:20:53 | FromDiscord | <LiteLotus> im pretty high functioning tho, just bad at grammar, not so much the words themselves |
16:21:08 | FromDiscord | <alehander42> hey guys |
16:21:27 | FromDiscord | <alehander42> yeah i've seen the struggle |
16:21:28 | FromDiscord | <ache of head> Wassup |
16:21:41 | FromDiscord | <alehander42> it's so strange when we all have faces! |
16:21:46 | FromDiscord | <alehander42> i am used to irc/gitter |
16:21:54 | FromDiscord | <vieru> im a cat |
16:22:00 | FromDiscord | <JSGRANT> @alehander42 Don't worry; Most are memes |
16:22:19 | FromDiscord | <LiteLotus> i tried irc, just thought everything else did it better. and gitter is always dead |
16:22:29 | FromDiscord | <alehander42> hm gitter works for me |
16:22:42 | FromDiscord | <LiteLotus> not the nim one, just all the other ones xD |
16:22:43 | FromDiscord | <alehander42> but i like to switch |
16:22:55 | FromDiscord | <alehander42> crystal is also ok |
16:22:57 | FromDiscord | <LiteLotus> couldnt justify using gitter just for nim |
16:22:59 | FromDiscord | <alehander42> typing etc |
16:23:07 | FromDiscord | <alehander42> but it depends on which communities you need |
16:23:15 | FromDiscord | <JSGRANT> IRC is slooooowly dying in-general; Freenode during the early 2000s was 'poppin' but has been on a major decline without anything really firmly taking its place |
16:23:25 | FromDiscord | <alehander42> discord is a bit dangerous |
16:23:28 | FromDiscord | <LiteLotus> i was 3 in 2000 |
16:23:34 | FromDiscord | <alehander42> as it's just a company i think |
16:23:43 | FromDiscord | <alehander42> dude my wife was 4 in 2000 |
16:23:49 | FromDiscord | <alehander42> you want scare me with your youth! |
16:23:59 | FromDiscord | <JSGRANT> @LiteLotus I'm not even 30 yet ... stop making me feel 50 lol |
16:24:13 | FromDiscord | <alehander42> (i was 8, so i almost remember the big new year stuff!) |
16:24:32 | FromDiscord | <JSGRANT> @alehander42 About the same, yeah |
16:24:41 | FromDiscord | <LiteLotus> i remember arriving in the UK 2 months after 2000 jan 1st |
16:24:45 | FromDiscord | <alehander42> @JSGRANT you look 42 |
16:24:50 | FromDiscord | <alehander42> in a good way |
16:24:53 | FromDiscord | <LiteLotus> i was 3 1/2 |
16:25:06 | FromDiscord | <vieru> i wasn't even existing in 2000 |
16:25:12 | FromDiscord | <vieru> lol |
16:25:25 | FromDiscord | <JSGRANT> @alehander42 That was taken when I was like 21 too; I'm nearlu 7 years older now |
16:25:36 | FromDiscord | <LiteLotus> <a:s_eyes:722096794833649725> |
16:25:39 | FromDiscord | <JSGRANT> n e a r l u |
16:25:41 | FromDiscord | <alehander42> i remember 4 years old atsea |
16:25:43 | FromDiscord | <JSGRANT> ahahahaha |
16:25:50 | FromDiscord | <alehander42> wow well good stuff |
16:25:57 | FromDiscord | <alehander42> i am not very good with dates probably |
16:26:01 | * | natrys joined #nim |
16:26:21 | FromDiscord | <LiteLotus> @JSGRANT you look like my old room mate but a little older |
16:27:06 | FromDiscord | <LiteLotus> @disruptek i need to setup my NVIM properly |
16:27:07 | FromDiscord | <JSGRANT> Did he also wear a comically small hat? |
16:27:16 | FromDiscord | <LiteLotus> yrah, a tiny fez |
16:27:22 | FromDiscord | <LiteLotus> (edit) 'yrah,' => 'yeah,' |
16:27:42 | disruptek | https://github.com/alaviss/nim.nvim#auto-completion |
16:27:50 | FromDiscord | <JSGRANT> How are you sure I'm not him, then? lol |
16:28:24 | FromDiscord | <LiteLotus> is your name Jake Adams |
16:28:56 | FromDiscord | <LiteLotus> @disruptek tyvm |
16:30:02 | FromDiscord | <JSGRANT> The first and last-name have the same amount of letters with the J being in the same places and the second-a in Adams being in the same places for Josh Grant -- so, pretty close; Explains my 5 years of amnesia |
16:30:35 | FromDiscord | <LiteLotus> :wheeze: |
16:40:20 | * | PMunch quit (Quit: leaving) |
16:41:02 | * | Trustable joined #nim |
16:43:52 | * | endragor joined #nim |
16:50:40 | * | waleee-cl joined #nim |
16:56:09 | * | FromDiscord quit (Remote host closed the connection) |
16:56:24 | * | FromDiscord joined #nim |
16:58:05 | * | krux02__ joined #nim |
17:01:22 | * | endragor quit (Ping timeout: 256 seconds) |
17:01:27 | * | krux02_ quit (Ping timeout: 240 seconds) |
17:08:15 | * | endragor joined #nim |
17:12:55 | * | endragor quit (Ping timeout: 256 seconds) |
17:21:52 | * | solitudesf quit (Remote host closed the connection) |
17:23:27 | * | agent0x00 quit (Ping timeout: 240 seconds) |
17:24:52 | * | Trustable quit (Remote host closed the connection) |
17:27:22 | FromDiscord | <Rika> who's incrementing the "times disruptek annoyed a newbie" counter |
17:38:06 | disruptek | i think it rolled over again. |
17:40:59 | * | pietroppeter quit (Quit: Connection closed for inactivity) |
17:42:07 | * | endragor joined #nim |
17:42:28 | superbia | why is doAssert("--port=1234"[7 .. ^3] == "12") not 1 |
17:42:54 | disruptek | indices are inclusive. |
17:43:11 | superbia | where is ^0 |
17:43:48 | disruptek | i guess it's just past the end of the collection. |
17:44:03 | superbia | so ^1 is "4" |
17:44:06 | disruptek | yes. |
17:44:14 | superbia | what logix is that |
17:44:36 | disruptek | think of it this way, does it make sense to write down values that /don't/ correspond to indices you want to retrieve? |
17:44:42 | disruptek | how is /that/ logical? |
17:45:28 | superbia | this is the first time I see Splice so my brain can't digest it |
17:45:35 | superbia | s/splice/slice |
17:45:46 | disruptek | it will grow on you. |
17:46:21 | disruptek | if it helps, ranges are inclusive, too. |
17:46:27 | disruptek | 1 .. 10 includes both 1 and 10. |
17:46:40 | disruptek | so [1 .. 10] is of course of the same length. |
17:46:42 | superbia | "0123456789"[3 .. ^3] := 3456 ? |
17:46:56 | disruptek | ^3 is 7, so, no. |
17:47:19 | superbia | ok i get it now |
17:47:33 | FromDiscord | <Rebel> you know you could just go to the playground and run these snippets |
17:47:33 | FromDiscord | <Rika> `^n` is `nth to the last` |
17:47:40 | FromDiscord | <Rika> or used eval |
17:47:53 | FromDiscord | <Rika> `!eval echo "0123456789"[3 .. ^3] == "3456"` |
17:47:59 | FromDiscord | <Rika> oops, without the `` |
17:48:03 | FromDiscord | <Rika> !eval echo "0123456789"[3 .. ^3] == "3456" |
17:48:05 | NimBot | false |
17:48:26 | superbia | disruptek: ok thanks. i understand it perfectly now |
17:48:32 | disruptek | see also ..< |
17:48:36 | superbia | i had some stuff in the past where this could be useful |
17:50:07 | * | krux02__ quit (Remote host closed the connection) |
18:04:35 | * | endragor quit (Ping timeout: 265 seconds) |
18:06:26 | * | awe001 joined #nim |
18:08:48 | * | tsujp quit (Ping timeout: 260 seconds) |
18:09:53 | FromDiscord | <Rebel> Is there a convenient way to convert nim to nimscript? |
18:09:58 | * | awe00 quit (Ping timeout: 260 seconds) |
18:10:28 | Zevv | leorize: I feel stupid. I have my nvim config on one machine that does not want to :q |
18:10:31 | Zevv | oh damn |
18:12:34 | FromDiscord | <Rika> @Rebel most nim code can be run in nimscript, but not all, so what's the issue? |
18:13:00 | FromDiscord | <Rebel> FFI |
18:13:22 | FromDiscord | <Rika> yeah that cant be dont in nimscript, what exactly about ffi? |
18:13:25 | FromDiscord | <Rika> done* |
18:13:35 | * | narimiran joined #nim |
18:15:35 | FromDiscord | <Rebel> hmmm just realized that wouldn't solve my predicament ignore that |
18:15:51 | FromDiscord | <Rebel> if I want to use Windows API functions in nimscript I just need to take the functionality and port it to pure nim |
18:15:52 | FromDiscord | <Rebel> (edit) 'nim' => 'nimscript' |
18:16:47 | * | a_chou quit (Ping timeout: 240 seconds) |
18:24:30 | * | gmaggior joined #nim |
18:35:39 | * | awe001 quit (Ping timeout: 256 seconds) |
18:36:29 | FromDiscord | <Lod> Just noticed github changed Nim color! 😄 |
18:38:28 | federico3 | if only it supported Nim properly |
18:39:04 | * | arecacea1 quit (Remote host closed the connection) |
18:39:36 | * | arecacea1 joined #nim |
18:41:57 | FromDiscord | <haxscramper> > if I want to use Windows API functions in nimscript I just need to take the functionality and port it to pure nimscript↵@Rebel If you want you can export nim procs to nimscript using `compiler/nimeval.implementRoutine`. Use example: https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim#L26 |
18:42:58 | * | solitudesf joined #nim |
18:43:13 | FromDiscord | <exelotl> I don't understand this PR, how is it different from `pairs`? https://github.com/nim-lang/Nim/pull/15297 |
18:43:14 | disbot | ➥ add `enumerate` macro |
18:44:46 | FromDiscord | <Rebel> hmmmm thanks haxscramper that's pretty cool |
18:45:26 | * | endragor joined #nim |
18:45:33 | narimiran | @exelotl it might replace `pairs` at some point. maybe. |
18:46:54 | Zevv | bah why does walkDir return a different type then walkDirRec |
18:46:58 | FromDiscord | <haxscramper> > I don't understand this PR, how is it different from `pairs`? ↵@exelotl `pairs` with indexes is implemented for `seq[]` openarray, but for user-defined collections (and types that already implement `pairs` differently) you need to use somewhat awkward loop constructs with `var idx` |
18:48:27 | FromDiscord | <Rebel> hexscramper any chance you have an example of exporting a proc that uses importc and the dynlib pragma such as TerminateProcess https://github.com/khchen/winim/blob/d300192c588f73dddef26e3c317f148aa23465c3/winim/inc/winbase.nim#L1939 and using nimeval.implementRoutine? |
18:55:07 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2xeF |
19:06:34 | gmaggior | s.delete(0,high(s)) is this the idiomatic way to delete all elements in a seq s? |
19:06:49 | FromDiscord | <Elegant Beef> `s.setlen(0)` |
19:06:50 | FromDiscord | <lqdev> s.setLen(0) |
19:06:59 | gmaggior | thanks! |
19:07:28 | FromDiscord | <Elegant Beef> sadly i dont think there is a way to just clear the seq whilst saving the capacity |
19:07:43 | * | endragor quit (Ping timeout: 260 seconds) |
19:07:46 | FromDiscord | <lqdev> wdym? |
19:07:59 | FromDiscord | <Elegant Beef> I believe setLen resets the capacity, so it frees memory |
19:08:03 | FromDiscord | <Rika> setlen doesnt lower capacity i dont think |
19:08:06 | FromDiscord | <lqdev> it doesn't |
19:10:51 | FromDiscord | <Elegant Beef> it didnt explictly state the capacity doesnt decrease so i was skeptical if it left the capacity 😄 |
19:17:28 | * | Perkol joined #nim |
19:21:24 | FromDiscord | <lqdev> it's an implementation detail |
19:21:38 | FromDiscord | <lqdev> you shouldn't worry about it, the stdlib will do the right thing. |
19:21:46 | * | a_chou joined #nim |
19:22:41 | FromDiscord | <Rebel> hmmm thanks hexscramper that doesn't look too bad I will play around with it later today |
19:30:47 | * | narimiran quit (Ping timeout: 240 seconds) |
19:32:14 | * | zyklon joined #nim |
19:32:59 | * | Perkol quit (Remote host closed the connection) |
19:33:27 | * | endragor joined #nim |
19:36:47 | * | Vladar quit (Quit: Leaving) |
19:40:52 | Araq | so ... optimizing my ORC algorithm makes valgrind happy what's up with that... |
19:42:20 | FromDiscord | <whisperdev> Is there any p2p lib for Nim? |
19:42:26 | FromDiscord | <Elegant Beef> You optimized the valgrind happiness generator? |
19:43:11 | * | endragor quit (Ping timeout: 265 seconds) |
19:56:54 | FromDiscord | <whisperdev> Araq is Denis Felsing someone you personally know? |
20:00:05 | FromDiscord | <Rika> kinda suspicious to ask that |
20:00:25 | disruptek | Araq: concepts... are they ready for testing? |
20:02:28 | FromDiscord | <Yardanico> @whisperdev that's def- https://github.com/def- |
20:10:29 | * | krux02 joined #nim |
20:11:10 | disruptek | adding timing to testes was totally worthwhile. |
20:16:42 | * | endragor joined #nim |
20:18:09 | * | femtotones joined #nim |
20:24:36 | shashlick | Busy morning looks like |
20:24:58 | disruptek | skiplists on arc are ~2.5x faster than refc. |
20:25:21 | disruptek | shashlick: can't wait for that nimble release to make it into nightlies. |
20:25:50 | disruptek | i've been working outside. gorgeous day here. |
20:25:51 | shashlick | What is it good for? |
20:25:59 | disruptek | testing packages. |
20:26:13 | shashlick | Just added namedBin |
20:26:34 | disruptek | the hits, the hits, the hits they just keep comin'. |
20:27:30 | shashlick | contemplating https://github.com/nim-lang/nimble/issues/542 |
20:27:31 | disbot | ➥ Possible to make `nimble install` install the binary built using a NimScript task |
20:28:34 | FromDiscord | <Avatarfighter> Ello everyone |
20:28:42 | disruptek | i don't understand it. |
20:28:44 | FromDiscord | <lqdev> hi |
20:29:05 | FromDiscord | <Avatarfighter> What is new @lqdev ? |
20:29:34 | FromDiscord | <lqdev> nothin', i'm on a creative block rn |
20:29:45 | disruptek | shashlick: why don't you just let people override the `install` task like they do `test`? |
20:29:52 | FromDiscord | <Avatarfighter> rip |
20:30:10 | shashlick | 29 nimble issues closed since Aug 1 |
20:30:33 | disruptek | he had to go for a run after that convo with litelotus. |
20:31:01 | disruptek | you are a badass shashlick, i don't care what rika says about you. |
20:31:03 | shashlick | I think he really wants `nimble build` to be overridden |
20:31:31 | shashlick | or at least a custom task that can add to the list of binaries |
20:31:39 | FromDiscord | <Avatarfighter> disruptek what is new are you on the west coast yet |
20:31:53 | shashlick | he's in the north eeeeast I think |
20:32:21 | disruptek | naw dawg, i can't travel without cashish. |
20:32:29 | FromDiscord | <Avatarfighter> yes but he said he was coming towards westcoast soon! Im trying to figure out when disruptekcon2020 is taking place |
20:32:34 | disruptek | anyway, i have to hit austin first. |
20:32:46 | disruptek | my truck only gets like 8mpg with my house behind it. |
20:32:53 | FromDiscord | <Avatarfighter> ah |
20:33:10 | shashlick | if that nimble proposal goes thru, we can kill another 11 issues, and perhaps even more |
20:33:12 | disruptek | ideally, i'd be in ca by spring. |
20:33:17 | shashlick | still need to go thru the full issue list |
20:33:23 | FromDiscord | <Avatarfighter> by spring jesus |
20:33:28 | * | lritter quit (Ping timeout: 260 seconds) |
20:33:33 | disruptek | well, i'm stone broke right now. |
20:33:33 | FromDiscord | <Avatarfighter> You taking the Oregon trail? |
20:33:45 | disruptek | fighting the feds to keep 'em from taking my shop. |
20:33:48 | FromDiscord | <Avatarfighter> aw 😦 |
20:33:50 | shashlick | what's in CA man, Austin's the place |
20:33:59 | * | lritter joined #nim |
20:34:17 | disruptek | pffbt texas can't compete with ca; it's embarrassing that you try. |
20:34:44 | shashlick | I don't try anything so it works |
20:34:47 | FromDiscord | <Avatarfighter> CA has me shashlick, hence why austin cant compete |
20:34:58 | disruptek | where are you, fighter? |
20:35:09 | FromDiscord | <Avatarfighter> im a bit south of SF |
20:35:18 | disruptek | big sur? |
20:35:35 | FromDiscord | <Avatarfighter> nah im in the middle of the silicon valley |
20:35:43 | FromDiscord | <Avatarfighter> mountain view |
20:36:00 | disruptek | lovely rents out there. |
20:36:09 | FromDiscord | <Avatarfighter> yeahhh |
20:36:22 | FromDiscord | <Avatarfighter> its definitely a bit of a problem |
20:36:22 | disruptek | camping in that area runs me almost $3k/month. |
20:36:50 | * | xet7 joined #nim |
20:36:58 | FromDiscord | <Avatarfighter> What sucks is that most of the area around me is on fire |
20:37:08 | disruptek | there is that, too, yeah. |
20:37:22 | * | krux02 quit (Remote host closed the connection) |
20:37:29 | FromDiscord | <Avatarfighter> i went camping to a campground and a week later its gone now |
20:37:44 | disruptek | i had to flee a fire in the sierras a couple years ago. |
20:37:56 | FromDiscord | <Avatarfighter> Fire is a little too fast |
20:38:07 | * | endragor quit (Ping timeout: 258 seconds) |
20:38:09 | FromDiscord | <Avatarfighter> its barely faster than the nim compile time |
20:38:22 | disruptek | 🔥 |
20:39:39 | FromDiscord | <LiteLotus> does anyone have a link to the enum documentation? |
20:39:44 | FromDiscord | <LiteLotus> i cant seem to find it |
20:40:16 | FromDiscord | <LiteLotus> im trying to see if an enum has a value equal to a string |
20:40:32 | disruptek | $someEnum == "someString" |
20:40:32 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#types-enumeration-types |
20:41:04 | disruptek | https://nim-by-example.github.io/types/enums/ |
20:41:24 | FromDiscord | <Avatarfighter> https://nim-lang.org/docs/manual.html#types-enumeration-types |
20:41:27 | disruptek | this site is almost illegible on my display. |
20:44:23 | FromDiscord | <Avatarfighter> Im going to see if i can get nim to compile on my phone |
20:44:28 | FromDiscord | <Avatarfighter> im burnt out rn 😦 |
20:44:46 | FromDiscord | <LiteLotus> i really should say what i really want to do. i want to set a variable to an enum valu but get the enum value from a string |
20:44:58 | FromDiscord | <LiteLotus> @Avatarfighter prety easy with termux |
20:45:06 | disruptek | parseEnum[SomeEnumType]("someString") |
20:45:19 | FromDiscord | <LiteLotus> termux has nim in its default repository |
20:45:22 | FromDiscord | <Avatarfighter> @LiteLotus on iOS though? |
20:45:23 | disruptek | strutils module. |
20:45:45 | FromDiscord | <LiteLotus> @Avatarfighter might be fucked on ios <:shrug_:641054621430841345> |
20:45:55 | FromDiscord | <LiteLotus> @disruptek ty my man |
20:45:59 | FromDiscord | <Avatarfighter> im jailbroken so i can probably do it just need to make sure nim doesnt consume my phone |
20:49:15 | FromDiscord | <LiteLotus> @disruptek ive gotten used to the doAssert thing |
20:49:23 | disruptek | i don't believe it. |
20:49:51 | FromDiscord | <LiteLotus> i know right |
20:50:28 | disruptek | what else is confusing? |
20:52:09 | FromDiscord | <LiteLotus> why i live |
20:53:15 | FromDiscord | <Avatarfighter> hey disruptek want to make httpclient support socks |
20:53:20 | disruptek | nope. |
20:53:27 | FromDiscord | <Avatarfighter> pretty please |
20:53:33 | disruptek | working on ic. |
20:53:37 | FromDiscord | <Avatarfighter> ic? |
20:53:44 | disruptek | incremental compilation. |
20:53:50 | FromDiscord | <Avatarfighter> ewwww |
20:53:56 | FromDiscord | <LiteLotus> 👀 |
20:54:08 | FromDiscord | <LiteLotus> is disruptek god? |
20:54:22 | FromDiscord | <Avatarfighter> no disruptek is disruptek |
20:54:32 | disruptek | 100% disruptek |
20:54:56 | FromDiscord | <Avatarfighter> Disruptek is built different 😈 |
20:55:24 | disruptek | !package disruptek |
20:55:24 | disbot | disruptek hung like rhinocerous🦏 |
20:55:33 | FromDiscord | <Avatarfighter> LMAO |
20:55:37 | FromDiscord | <ache of head> lmao |
20:55:52 | disruptek | disbot: you so horny? |
20:55:53 | disbot | yep. 😊 |
20:56:00 | disruptek | hmm. |
20:56:21 | FromDiscord | <Avatarfighter> Can irc see images i send? |
20:56:45 | disruptek | we usually get links. |
20:57:23 | FromDiscord | <LiteLotus> :No: |
20:58:05 | bozaloshtsh | will nim ever be able to infer none() as none[T]() when my proc returns Option[T]? |
20:58:13 | bozaloshtsh | (sorry if sent twice, may have been dc'd first time) |
20:58:22 | disruptek | it does this already. |
20:58:31 | bozaloshtsh | oh. |
20:59:20 | bozaloshtsh | http://ix.io/2xfk |
20:59:25 | bozaloshtsh | this gives me "could not instantiate: T" |
20:59:50 | disruptek | result is none() by default; so simply `result = some` or don't set result. |
21:00:01 | bozaloshtsh | ah gotcha |
21:00:14 | disruptek | if g.getMoveCount > 0: some(...) # sufficient |
21:00:32 | bozaloshtsh | would be nice if it could deduce that T=MCMove, this is a bit of a simplified example |
21:00:46 | disruptek | well, help us out by making it a generic. |
21:01:13 | disruptek | !repo badresults |
21:01:14 | disbot | https://github.com/disruptek/badresults -- 9badresults: 11like results but worse 15 0⭐ 0🍴 |
21:01:30 | disruptek | who here knows how to use koch? |
21:01:52 | FromDiscord | <Recruit_main707> when a function argument type is `ptr T` isnt `nil` a valid arg? |
21:01:56 | disruptek | i'm told there's some trick involving the motion of the ocean. |
21:02:11 | disruptek | recruit: nil.SomeType |
21:02:38 | disruptek | nil as ptr argument will eventually require such a conversion to avoid bugs. |
21:04:58 | femtotones | why % not mod |
21:05:08 | FromDiscord | <Recruit_main707> `nil.GLint`↵`Error: type mismatch: got <typeof(nil)> but expected 'GLint = int32'` |
21:05:23 | femtotones | recruit: 4 % 2 |
21:05:58 | disruptek | it doesn't appear to accept a ptr. |
21:06:10 | femtotones | isnt that an expression |
21:06:13 | femtotones | oh sorry nvm |
21:06:27 | FromDiscord | <Recruit_main707> nvm, it works now with only nil, magic moment of the day |
21:06:52 | disruptek | creepy. |
21:06:52 | femtotones | oh sorry thought you were a bot lmao |
21:07:12 | FromDiscord | <Rika> recruit is now a bot lol |
21:07:38 | FromDiscord | <Recruit_main707> lmfao |
21:07:50 | FromDiscord | <Recruit_main707> this is too good |
21:08:38 | FromDiscord | <Recruit_main707> you can do !eval ... for a real bot |
21:13:52 | * | gmaggior quit (Ping timeout: 246 seconds) |
21:16:28 | FromDiscord | <JSGRANT> @disruptek That results lib should've been called "badnews" lol |
21:17:07 | disruptek | i tried to pr results but they didn't like my changes. |
21:17:24 | disruptek | !repo nim-results |
21:17:25 | disbot | https://github.com/xyb/googlesearch.nim -- 9googlesearch.nim: 11Nim library for scraping google search results 15 4⭐ 1🍴 7& 3 more... |
21:17:28 | disruptek | !repo results |
21:17:29 | disbot | https://github.com/xyb/googlesearch.nim -- 9googlesearch.nim: 11Nim library for scraping google search results 15 4⭐ 1🍴 7& 7 more... |
21:17:31 | disruptek | damnit. |
21:17:33 | FromDiscord | <JSGRANT> rip |
21:17:43 | disruptek | well, there's one out there. |
21:17:57 | FromDiscord | <JSGRANT> https://github.com/arnetheduck/nim-result ? |
21:18:00 | disruptek | yeah. |
21:19:15 | FromDiscord | <JSGRANT> @disruptek Btw, that was an attempt at a pun; "On negative / bad news." and not a statement about the existence of the lib -- if I wasn't clear lol |
21:19:24 | disruptek | no, i get it. |
21:19:44 | disruptek | just explaining why it has to be `badresults` instead. 😉 |
21:20:45 | FromDiscord | <JSGRANT> Spurned lover territory; lol |
21:24:20 | * | endragor joined #nim |
21:26:55 | * | gmaggior joined #nim |
21:30:57 | FromGitter | <janni-adamski> Hi! Does nim support introspection? And if yes, is there an easy example? A link would be great. :) |
21:31:05 | disruptek | not really, no. |
21:31:22 | disruptek | i assume you mean runtime introspection. |
21:31:44 | FromGitter | <janni-adamski> compile time introspecction would be good too |
21:31:54 | disruptek | nim is not python. you can do everything you might want to do at compile-time. |
21:32:52 | disruptek | ~manual |
21:32:53 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
21:32:56 | disruptek | check out the section on macros. |
21:32:58 | FromGitter | <janni-adamski> so an example of how to read e.g. the properties of a type or a subtype |
21:33:30 | disruptek | see also |
21:33:33 | disruptek | !repo macroutils |
21:33:34 | disbot | https://github.com/PMunch/macroutils -- 9macroutils: 11A package that makes creating macros easier 15 15⭐ 1🍴 |
21:35:44 | FromGitter | <janni-adamski> thanks! |
21:36:51 | disruptek | sure thing. |
21:37:54 | FromDiscord | <LiteLotus> @disruptek what am i missing? $ checks the type right? https://play.nim-lang.org/#ix=2xfw |
21:38:06 | disruptek | $ converts the argument to a string. |
21:38:15 | FromDiscord | <LiteLotus> ah |
21:38:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:38:42 | FromDiscord | <LiteLotus> how would i check to see if the string is a valid option for this enum? |
21:39:34 | disruptek | try to parse it, or see if it appears in a hashset of enums-as-strings, or iterate over all the enums and compare their string values, or or or |
21:39:56 | FromDiscord | <LiteLotus> ok. i guess i could put a try catch around a parse |
21:45:40 | FromDiscord | <Recruit_main707> I whish those macro utils were a thing by default |
21:46:00 | disruptek | they need more testing, imo. |
21:46:08 | disruptek | !requires macroutils |
21:46:09 | disbot | macroutils: 11haxscramper/misc, 11juancarlospaco/3fision, 11mhessler97/3NimFuzzy 73 total |
21:46:19 | disruptek | not exactly wide deployment. |
21:58:08 | FromDiscord | <XxDiCaprioxX> trying to reference# a file in the same folder is `/filename.type` correct? |
21:58:14 | FromDiscord | <XxDiCaprioxX> (edit) 'reference#' => 'reference' |
21:58:24 | FromDiscord | <XxDiCaprioxX> (edit) 'trying' => 'the path' | removed 'reference' |
21:58:28 | disruptek | itym `./filename` |
21:58:48 | FromDiscord | <XxDiCaprioxX> `openingsPath = "/db.json"` |
21:58:50 | disruptek | `filename` would work, too. 😉 |
21:58:51 | FromDiscord | <XxDiCaprioxX> this does not work |
21:59:00 | FromDiscord | <XxDiCaprioxX> it is in the same folder |
21:59:04 | FromDiscord | <XxDiCaprioxX> what do I need to change? |
21:59:04 | disruptek | echo getCurrentDir() |
21:59:14 | FromDiscord | <Rika> i think one of the main reasons people arent using macroutils is because "they dont want to add more dependencies" or w/e |
21:59:40 | FromDiscord | <XxDiCaprioxX> wdym with echo getCurrentDir() ? |
21:59:40 | disruptek | that's one reason i didn't use it in cps. |
21:59:47 | FromDiscord | <XxDiCaprioxX> Let my program do that? |
22:00:06 | disruptek | i have a feeling you and your program may disagree about where it is executing. |
22:00:08 | FromDiscord | <Rika> you can use `getCurrentDir() / "filename"` or so |
22:00:11 | FromDiscord | <LiteLotus> echo getCurrentDir() gets the programs folder path. you can append the file to that |
22:00:19 | FromDiscord | <LiteLotus> what rika said |
22:00:30 | disruptek | you shouldn't need to, though. |
22:00:35 | FromDiscord | <Rika> yeah |
22:00:39 | FromDiscord | <XxDiCaprioxX> actually the '/' was the problem |
22:00:42 | FromDiscord | <Rika> `"./filename"` should work |
22:00:43 | FromDiscord | <XxDiCaprioxX> thanks anyways |
22:00:51 | FromDiscord | <Rika> yeah, the period is important |
22:01:02 | FromDiscord | <LiteLotus> yeah i think he just forgot the `.` before the `/` |
22:01:14 | disruptek | just use `filename` so it's more portable. |
22:01:22 | FromDiscord | <LiteLotus> true |
22:01:49 | FromDiscord | <LiteLotus> but if this is designed to run on linux you'll be storing / reading a file in the bin folder if its installed |
22:02:00 | disruptek | if you must use paths, use them like `"directory" / "filename"` and nim will insert the correct DirSep. |
22:02:27 | FromDiscord | <LiteLotus> goot to know |
22:02:31 | FromDiscord | <LiteLotus> (edit) 'goot' => 'good' |
22:02:40 | FromDiscord | <Rika> ...after `import`ing `os` because / for strings is only found in os |
22:02:46 | FromDiscord | <LiteLotus> i've been writing them out as a full string |
22:03:12 | FromDiscord | <LiteLotus> i mean if your doing file stuff it would be smart to import os anyway |
22:03:28 | disruptek | compiler/pathutils is actually a much better approach. |
22:07:02 | FromDiscord | <Avatarfighter> hey rika |
22:10:41 | federico3 | odd, the compiler is ignoring --cpu:arm64 |
22:12:59 | FromDiscord | <XxDiCaprioxX> Is there a way of quickly removing quotes from a string? |
22:13:17 | disruptek | you mean, like, unescape? |
22:13:21 | FromDiscord | <XxDiCaprioxX> Like `var str = ""Hello""` and the nget rid of the second set of quotes |
22:13:29 | FromDiscord | <XxDiCaprioxX> (edit) 'the nget' => 'then get' |
22:13:35 | disruptek | see strutils.unescape. |
22:14:50 | * | natrys quit (Quit: natrys) |
22:15:42 | FromDiscord | <XxDiCaprioxX> I dont understand do I write `unescape(str, """, """)` ? |
22:16:20 | FromDiscord | <XxDiCaprioxX> no thats incorrect runtime error |
22:16:45 | FromDiscord | <Avatarfighter> unescape defaults to escaping quotes |
22:16:46 | disruptek | var str = """"Hello"""" |
22:16:55 | disruptek | echo unescape(str) |
22:17:24 | FromDiscord | <XxDiCaprioxX> what |
22:17:40 | FromDiscord | <XxDiCaprioxX> Okay so what exactly is the command for removing a quote and beginning and end? |
22:17:48 | disruptek | !eval import strutils; var s = """"Hello""""; echo unescape(s) |
22:17:50 | NimBot | Hello |
22:18:06 | disruptek | !eval import strutils; var s = """goat "Hello" fucker"""; echo unescape(s) |
22:18:08 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/pure/strutils.nim(2232) unescape↵Error: unhandled exception: String does not start with: " [ValueError] |
22:18:15 | FromDiscord | <Avatarfighter> sent a code paste, see https://play.nim-lang.org/#ix=2xfF |
22:18:22 | FromDiscord | <XxDiCaprioxX> okay thanks perfect |
22:18:55 | disruptek | the """ syntax allows you to embed " inside the string. |
22:19:09 | disruptek | !eval import strutils; var s = "\"Hello\""; echo unescape(s) |
22:19:11 | NimBot | Hello |
22:19:19 | disruptek | alternatively, escape the quotes. |
22:19:21 | FromDiscord | <XxDiCaprioxX> Okay I got it now thanks |
22:19:57 | * | arecacea1 quit (Remote host closed the connection) |
22:20:16 | * | arecacea1 joined #nim |
22:25:51 | federico3 | oh what a bug |
22:34:00 | * | a_chou quit (Ping timeout: 256 seconds) |
22:47:51 | FromDiscord | <Sabena Sema> where the heck are the docs for type bound procs |
22:47:55 | FromDiscord | <Sabena Sema> I can't find em anymore |
23:08:19 | FromDiscord | <Rika> type bound procs? |
23:11:22 | FromDiscord | <Rika> did we ever have type bound procs? |
23:23:08 | FromDiscord | <Sabena Sema> like =sink =destroy and so on |
23:24:22 | FromDiscord | <Rika> https://nim-lang.org/docs/destructors.html |
23:24:22 | FromDiscord | <Sabena Sema> it's ... been a while since I've used nim |
23:24:54 | FromDiscord | <Sabena Sema> hmm nim-lang.org/docs could use a link to that |
23:25:43 | * | lritter quit (Quit: Leaving) |
23:32:27 | * | endragor quit (Ping timeout: 240 seconds) |
23:33:39 | * | gmaggior quit (Read error: Connection reset by peer) |
23:33:51 | * | abm joined #nim |
23:39:40 | * | endragor joined #nim |
23:44:13 | * | endragor quit (Ping timeout: 260 seconds) |
23:47:37 | * | krux02 joined #nim |
23:50:16 | * | endragor joined #nim |
23:53:44 | FromDiscord | <Avatarfighter> Is there a nim webview library or something? |
23:54:03 | FromDiscord | <Avatarfighter> Is there a way for me to render html/css as a gui ? |
23:55:06 | * | endragor quit (Ping timeout: 256 seconds) |
23:55:40 | FromDiscord | <Avatarfighter> found one |
23:55:49 | FromDiscord | <Avatarfighter> time to see if it works with ARC >:) |