01:39:51 | * | lucasta joined #nim |
03:10:30 | FromDiscord | <spaceshaman> is there a compiler flag that forces you to use parentheses for all function calls? |
03:11:35 | FromDiscord | <spaceshaman> sent a long message, see https://pasty.ee/TkuiKHWT |
03:15:16 | FromDiscord | <Elegantbeef> Nope |
03:47:02 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
03:49:48 | * | cornfeedhobo joined #nim |
04:08:59 | FromDiscord | <zumi.dxy> In reply to @spaceshaman "is there a compiler": But you can use `from X import nil`, now UFCS will be unviable :D |
04:09:31 | FromDiscord | <zumi.dxy> The one thing you can't is `system` however, since that's auto-imported |
04:10:28 | * | cornfeedhobo quit (Quit: ZNC - https://znc.in) |
04:11:47 | * | cornfeedhobo joined #nim |
04:16:20 | * | lucasta quit (Quit: Leaving) |
04:18:12 | FromDiscord | <spaceshaman> that would be undesireable as ufcs is nice |
04:45:51 | * | disso-peach joined #nim |
05:16:51 | FromDiscord | <zumi.dxy> In reply to @spaceshaman "ie `11.echo()` `11.echo`": i mean, that would technically force all function calls to be like this |
05:17:06 | FromDiscord | <zumi.dxy> `echo(11)` |
05:17:44 | FromDiscord | <zumi.dxy> I missed the part where you only wanted "force parentheses" |
05:18:32 | FromDiscord | <zumi.dxy> because with that technically `echo 1, 2, 3` is still possible... |
05:20:08 | FromDiscord | <Elegantbeef> It'd require a fork to the compile and to emit a warning/error |
05:22:25 | FromDiscord | <spaceshaman> I find it really damn funny that zig has strict indentation, strict (read static) typing, and yet names can be whatever you want and you can just omit parentheses as if its haskel |
05:22:39 | FromDiscord | <spaceshaman> (edit) "I find it really damn funny that zig has strict indentation, strict (read static) typing, and yet names can be whatever you want and you can just omit parentheses as if its haskel ... " added "or include them like its anything else" |
05:22:49 | FromDiscord | <Elegantbeef> Zig's strict variable usage has to be the most inane thing I've seen |
05:23:09 | FromDiscord | <spaceshaman> nim |
05:23:11 | FromDiscord | <spaceshaman> NIM |
05:23:14 | FromDiscord | <spaceshaman> I meant nim |
05:23:20 | FromDiscord | <spaceshaman> 3 letter pl names |
05:23:54 | FromDiscord | <spaceshaman> (edit) "zig" => "[edit] nim" |
05:24:11 | FromDiscord | <Elegantbeef> Too late I flamed Zig |
05:24:49 | FromDiscord | <spaceshaman> what is it? |
05:25:13 | FromDiscord | <spaceshaman> return values must be used? |
05:25:22 | FromDiscord | <Elegantbeef> A programming language |
05:25:37 | FromDiscord | <spaceshaman> wdym 'Zig's strict variable usage' |
05:25:37 | FromDiscord | <Elegantbeef> In Zig? Variables must be used |
05:25:45 | FromDiscord | <spaceshaman> oh ok |
05:25:49 | FromDiscord | <Elegantbeef> If they're not used you must annotate them `_bleh` |
05:29:14 | FromDiscord | <spaceshaman> bit of a nuisance |
05:29:27 | FromDiscord | <spaceshaman> where can I read about whats in the works for nim |
05:29:47 | FromDiscord | <spaceshaman> Like if they're working on better taged unions / sumtypes |
05:30:15 | FromDiscord | <spaceshaman> or optional types |
05:30:15 | FromDiscord | <Elegantbeef> Nim's RFC issue tracker |
05:49:07 | FromDiscord | <bubbly_avocado_86424> In reply to @Elegantbeef "Zig's strict variable usage": what do you mean by that? |
05:49:38 | FromDiscord | <Elegantbeef> Zig requires you to prefix with an underscore if a variable is not used and errors if you do not |
06:20:58 | FromDiscord | <bubbly_avocado_86424> I've seen Nim also stop compilation when some things are not used, I wonder why it not just omits that line from compilation. |
06:28:46 | FromDiscord | <ayex> on my machines when something is not used, that is only a warning by the nim compiler. |
06:29:13 | FromDiscord | <ayex> on my machines when something is not used, that is only a warning by the nim compiler - it still compiles the project fine. |
06:29:43 | FromDiscord | <Elegantbeef> Yea it's not an error in Nim |
06:41:36 | * | disso-peach quit (Quit: Leaving) |
06:43:28 | FromDiscord | <bubbly_avocado_86424> yeah, i may've not paid adequate attention there |
06:58:24 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=qFcFLbod |
06:58:56 | FromDiscord | <Elegantbeef> Why are you using the shell to get the md5 sum of something? |
06:59:13 | FromDiscord | <TFed> is there a function for it? |
07:00:17 | FromDiscord | <Elegantbeef> In the checksums package yes |
07:00:46 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
07:01:11 | * | SchweinDeBurg joined #nim |
07:05:12 | FromDiscord | <TFed> Oh🤔\: Note\: In order to use this module, run `nimble install checksums` |
07:05:19 | FromDiscord | <TFed> i will try it |
07:07:15 | FromDiscord | <ayex> if you mostly check files, crunchy might be interesting as well\:↵https://github.com/guzba/crunchy↵↵I found it quite convenient and nicely documented |
07:08:29 | FromDiscord | <ayex> oh wait, nvm\: it does not seem to have md5 - I used it for sha256. |
07:08:58 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300354696459980811): i will try it↵↵https://nim-lang.org/docs/md5.html |
07:09:46 | FromDiscord | <TFed> yup for each package (in my package manager) i need hash |
07:10:52 | FromDiscord | <TFed> well, I just use it for ID, i can change to sha256 later |
07:13:58 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=PKMzlfnC |
07:15:53 | FromDiscord | <Elegantbeef> Hmph no way to stream it automagically |
07:16:06 | FromDiscord | <Elegantbeef> Shame that one has to load it all into memory |
07:16:09 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=UmfJdpdu |
07:16:33 | FromDiscord | <ayex> you can memory map also - it is shown in crunchy docs |
07:17:32 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=GAoifOjX |
07:51:16 | FromDiscord | <aintea> In reply to @spaceshaman "or optional types": Well there are optional types in Nim, and for sum types they are working on it, or at least that's what a pull request opened by the creator of the language says |
08:43:45 | FromDiscord | <beetroit> Anyone using nim for Solana smart contracts yet? |
08:49:25 | FromDiscord | <gogolxdong666> for what |
08:50:43 | * | xet7 quit (Remote host closed the connection) |
09:01:36 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=KzzrUSSZ |
09:22:35 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=VYpItVav |
09:22:35 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=xzHBAtwk |
09:22:58 | FromDiscord | <Elegantbeef> It's an issue with nimble |
09:23:14 | FromDiscord | <Elegantbeef> It's attempting to iterate the wrong thing of the json file |
09:25:12 | FromDiscord | <TFed> \~/.nimble/packages\_official.json has\:↵`{}` |
09:27:02 | FromDiscord | <k0ts> That file is supposed to contain an array of package infos |
09:27:18 | FromDiscord | <k0ts> You can delete it and get nimble to redownload it |
09:31:11 | FromDiscord | <TFed> it's empty |
09:31:23 | FromDiscord | <TFed> i have to rm, and then nimble update? |
09:32:15 | FromDiscord | <k0ts> nimble refresh, yeah |
09:33:00 | FromDiscord | <k0ts> Though it's not normal that that file got like that in the first place |
09:35:49 | FromDiscord | <TFed> it's my fault 😄 I just skipped the installation of nimble |
09:36:29 | FromDiscord | <TFed> when i tried nim, it's amazing, and i actually can use it, so now i have to install it with nimble 😄 |
09:37:34 | FromDiscord | <TFed> i was just tried nim, it was amazing, so i think i can use it, so now i have to install it with nimble 😄 |
09:44:06 | anddam | howdy, how would I start in order to targetting STM32 microcontrollers with nim? |
09:45:08 | anddam | I am looking this small project https://github.com/mwbrown/nim_stm32f3/blob/master/nim.cfg |
09:46:20 | anddam | seems I just need the arm-none-eabi-gcc toolchain and then a few build options, like --cpu:arm and I guess the --passC is important to control the cc |
09:46:49 | anddam | can you recommend a starting guide for embedded targets? |
09:50:06 | * | xet7 joined #nim |
09:55:47 | * | ntat joined #nim |
10:20:38 | * | ntat quit (Quit: Leaving) |
10:23:39 | FromDiscord | <TFed> yup, after `nimble install nim` everything works now |
10:43:59 | FromDiscord | <demotomohiro> @anddam Nim Compiler User Guide explains about these options: https://nim-lang.org/docs/nimc.html |
11:38:59 | * | beholders_eye joined #nim |
11:41:10 | FromDiscord | <ayex> sent a long message, see https://pasty.ee/yhZtFyjW |
13:01:51 | * | beholders_eye quit (Quit: WeeChat 4.1.2) |
13:03:14 | anddam | thx both |
13:03:27 | anddam | I also found this with useful hints https://www.mail-archive.com/[email protected]/msg17733.html |
13:14:13 | * | beholders_eye joined #nim |
13:15:52 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=hFrOpBge |
13:16:08 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=aZiOVTui |
13:20:22 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#pasty=cFvzIZxD |
13:22:54 | FromDiscord | <ayex> [michaelb.eth](https://matrix.to/#/%40_discord_383034029135364096%3At2bot.io) that is it - thank you! 😀 |
13:25:02 | FromDiscord | <ayex> although it seem it cannot be combined with fmt"" ? |
14:07:38 | FromDiscord | <TFed> sent a code paste, see https://play.nim-lang.org/#pasty=TrbZCTLQ |
14:10:04 | FromDiscord | <TFed> is it illigal to have config/ for configs, lib/ for modules and src/ for sources of programms? |
14:10:51 | FromDiscord | <ayex> it is currently just a warning.↵↵if you setup your projects up with `nimble init` you should be good to go. |
14:11:27 | FromDiscord | <TFed> in the future it won't be allowed? |
14:11:53 | FromDiscord | <TFed> in the future it will be not allowed? |
14:12:16 | FromDiscord | <k0ts> I was under the impression that recent versions of nimble have removed that warning |
14:13:34 | FromDiscord | <TFed> so it's better to have a single directory for sources? even if i have configs separately... |
14:25:03 | FromDiscord | <k0ts> > so it's better to have a single directory for sources?↵↵There's some discussion here: https://forum.nim-lang.org/t/11942↵I don't personally know what the implications of using the formerly "wrong" package structure are, because I don't use nimble |
14:32:41 | FromDiscord | <TFed> 😕 I already in panic rewrote code↵(@k0ts) |
14:34:36 | FromDiscord | <TFed> sent a long message, see https://pasty.ee/vfVUdYlN |
14:34:51 | FromDiscord | <TFed> sent a long message, see https://pasty.ee/dEOAmEEr |
14:35:02 | FromDiscord | <TFed> srs/upman/srs🤣 |
14:35:21 | FromDiscord | <TFed> src/upman/src🤣 |
14:35:46 | FromDiscord | <TFed> i will revert back, that warning forced me to make everything worse |
14:38:54 | FromDiscord | <TFed> sent a long message, see https://pasty.ee/GPWhEoIh |
14:43:29 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300468058045026305): i will revert back |
15:06:31 | FromDiscord | <zumi.dxy> I saw this bit was advertised in the old Nim site: https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn-parallel-statement↵how valuable/useful is this now? |
16:24:34 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300468058045026305): i will revert back, probably i won't use .nimble for my project, since i'm writing my own pm |
16:29:26 | * | disso-peach joined #nim |
16:43:06 | * | lucasta joined #nim |
16:47:19 | * | lucasta quit (Remote host closed the connection) |
16:47:43 | * | lucasta joined #nim |
16:48:19 | * | Ekho quit (Quit: CORE ERROR, SYSTEM HALTED.) |
16:48:24 | * | lucasta quit (Remote host closed the connection) |
16:48:46 | * | lucasta joined #nim |
16:49:45 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300468058045026305): i will revert back, probably i won't use .nimble for my project, cuz i'm writing my own pm |
16:49:51 | * | lucasta quit (Remote host closed the connection) |
17:10:37 | * | Ekho joined #nim |
17:23:30 | * | disso-peach quit (Quit: Leaving) |
17:25:25 | FromDiscord | <michaelb.eth> In reply to @zumi.dxy "I saw this bit": current advice is to use malebolgia, iiuc |
17:37:03 | * | coldfeet joined #nim |
17:50:07 | * | coldfeet quit (Remote host closed the connection) |
17:53:32 | FromDiscord | <Robyn [She/Her]> In reply to @TFed "[Edit](https://discord.com/channels/371759389889003": you're writing a pkg manager? |
17:54:13 | FromDiscord | <Robyn [She/Her]> i had a go but couldn't be bothered trying to get it even able to clone versions of projects |
18:19:48 | FromDiscord | <TFed> This is my first project, and i'm not doing it from scratch 😄 there is many tools out there\: git, upm, atool, aur, pip, nimble, tar, etc. |
18:19:48 | FromDiscord | <TFed> i just wanna use it |
18:19:48 | FromDiscord | <TFed> i just wanna use it, if i need that in my package manager |
18:26:55 | FromDiscord | <morgan (ping with reply)> anyone know what encoding char uses? like is it original ascii, or one of the later extensions like latin-1, latin-9, windows-1252? |
18:27:09 | FromDiscord | <morgan (ping with reply)> i suppose i could just print out a table |
18:28:37 | FromDiscord | <morgan (ping with reply)> ok yea original ascii |
18:28:55 | Amun-Ra | char is almost just an octet |
18:29:44 | FromDiscord | <morgan (ping with reply)> the top bit is unused, like with og ascii |
18:30:02 | FromDiscord | <morgan (ping with reply)> the others extend it to 8 bits |
18:30:15 | Amun-Ra | let s = "\xff" |
18:30:24 | Amun-Ra | perfectly valid, top bit is used |
18:30:40 | Amun-Ra | https://nim-lang.org/docs/tut1.html#basic-types-characters |
18:31:59 | FromDiscord | <morgan (ping with reply)> ok the encoding echo uses with char/string |
18:32:35 | Amun-Ra | echo outputs octets, they are interpreted by the terminal |
18:33:06 | FromDiscord | <michaelb.eth> In reply to @morganalyssa "anyone know what encoding": wat? |
18:33:39 | Amun-Ra | char is like a distinct byte |
18:34:11 | FromDiscord | <michaelb.eth> exactly, the question doesn’t make sense |
18:34:17 | FromDiscord | <morgan (ping with reply)> ok i wasn't sure if it converted to a consistent encoding to output to, fair enough |
18:34:32 | FromDiscord | <morgan (ping with reply)> i guess terminals don't necessarily support unicode |
18:35:13 | Amun-Ra | default encoding in my terminal emulator is utf-8, echo "\xc5\xba" will output 'ź; |
18:36:07 | FromDiscord | <michaelb.eth> this stuff can get tricky to understand: character set vs encoding vs locale, and how those things relate |
18:36:08 | FromDiscord | <morgan (ping with reply)> ah ok then i guess it's just on my end then |
18:37:31 | Amun-Ra | strings are generally considered to be utf-8 encoded |
18:37:47 | FromDiscord | <michaelb.eth> the char that make up a Nim string are essentially just bytes, and usually you’re dealing with utf-8 |
18:37:57 | Amun-Ra | if you'd like to iterate over utf-8 runes see std/unicode |
18:39:36 | FromDiscord | <morgan (ping with reply)> im just doing some visual debugging |
18:40:09 | FromDiscord | <morgan (ping with reply)> i wanted a ¯ to go along with _ but ill deal with ^ |
18:46:42 | * | ntat joined #nim |
18:57:56 | * | Artea quit (Remote host closed the connection) |
19:41:30 | * | beholders_eye quit (Quit: WeeChat 4.1.2) |
19:44:59 | * | disso-peach joined #nim |
20:06:53 | * | disso-peach quit (Remote host closed the connection) |
20:13:40 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/eciRWafF |
20:14:09 | FromDiscord | <Elegantbeef> Variables can be but into arrays but it copies them |
20:14:09 | FromDiscord | <Elegantbeef> be put\ |
20:14:43 | FromDiscord | <bubbly_avocado_86424> okay, then what is recommended to have a list of objects ? |
20:15:25 | FromDiscord | <Elegantbeef> Use a sequence |
20:19:20 | FromDiscord | <bubbly_avocado_86424> the irony, i had worked with a sequence, then decided on a register of objects↵will try |
20:24:10 | FromDiscord | <TFed> what is `tests/config.nims``switch("path", "$projectDir/../src")` |
20:24:12 | FromDiscord | <TFed> what is `tests/config.nims``switch("path", "$projectDir/../src")` ? |
20:24:24 | FromDiscord | <TFed> what is this in `tests/config.nims`\:`switch("path", "$projectDir/../src")` ? |
20:25:06 | Amun-Ra | it adds src path for tests |
20:25:10 | FromDiscord | <TFed> switch moves you into dir with libs, or appends PATH with source dirs? |
20:25:25 | FromDiscord | <TFed> so i can add one pathes? |
20:25:27 | FromDiscord | <TFed> cool |
20:25:31 | Amun-Ra | sure |
20:25:34 | FromDiscord | <Elegantbeef> `switch` is just a compiler switch |
20:25:44 | FromDiscord | <Elegantbeef> `path` is how Nim find's `.nim` files |
20:25:49 | FromDiscord | <TFed> a so "path" is actually a command |
20:25:58 | Amun-Ra | patch is a switch |
20:26:13 | Amun-Ra | switch "path", "foo" is an equivalent of --path=foo |
20:26:47 | Amun-Ra | s/patch/path/ |
20:28:14 | FromDiscord | <TFed> thanks |
20:28:15 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300556147085807700): a so "path" is actually a command to append pathes |
20:28:39 | FromDiscord | <Elegantbeef> On the command line it'd be `--path:"$projectDir/../src"` |
20:29:25 | FromDiscord | <TFed> i got it, okay |
20:35:25 | * | ntat quit (Quit: Leaving) |
20:54:02 | FromDiscord | <TFed> is projectDir a place where .nimble or where .nim was run?for example `nimle test` runs form tests↵`nimble run` runs from current dir and .nimble |
20:54:15 | FromDiscord | <TFed> is `$projectDir` a place where .nimble or where .nim was run?for example `nimle test` runs form tests↵`nimble run` runs from current dir and .nimble |
20:54:32 | FromDiscord | <Elegantbeef> Should be the entry to the program |
20:54:34 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300563301582901340): is `$projectDir` a place where .nimble is, or where .nim was runned?for example `nimle test` runs form tests↵`nimble run` runs from current dir and .nimble |
20:54:50 | FromDiscord | <Elegantbeef> hence why it's `$projectDir/../` |
20:55:05 | FromDiscord | <Elegantbeef> It's a file in `tests` which means you need to do `../` |
20:56:32 | FromDiscord | <TFed> so in this case projectDir is a tests and with .. i got to the parrent dir |
20:56:36 | FromDiscord | <TFed> so in this case projectDir is a tests and with .. i got to the parent dir |
20:56:40 | FromDiscord | <Elegantbeef> Yes |
20:56:43 | FromDiscord | <TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300563893428551753): so in this case projectDir is a tests and with `..` i got to the parent dir |
21:06:17 | Amun-Ra | yes |
21:36:09 | FromDiscord | <michaelb.eth> In reply to @TFed "[Edit](https://discord.com/channels/371759389889003": > The project file name is the name of the .nim file that is passed as a command-line argument to the compiler … $projectDir stands for the project file's path↵↵https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files |
23:18:29 | * | lucasta joined #nim |