<< 28-10-2024 >>

01:39:51*lucasta joined #nim
03:10:30FromDiscord<spaceshaman> is there a compiler flag that forces you to use parentheses for all function calls?
03:11:35FromDiscord<spaceshaman> sent a long message, see https://pasty.ee/TkuiKHWT
03:15:16FromDiscord<Elegantbeef> Nope
03:47:02*cornfeedhobo quit (Quit: ZNC - https://znc.in)
03:49:48*cornfeedhobo joined #nim
04:08:59FromDiscord<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:31FromDiscord<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:12FromDiscord<spaceshaman> that would be undesireable as ufcs is nice
04:45:51*disso-peach joined #nim
05:16:51FromDiscord<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:06FromDiscord<zumi.dxy> `echo(11)`
05:17:44FromDiscord<zumi.dxy> I missed the part where you only wanted "force parentheses"
05:18:32FromDiscord<zumi.dxy> because with that technically `echo 1, 2, 3` is still possible...
05:20:08FromDiscord<Elegantbeef> It'd require a fork to the compile and to emit a warning/error
05:22:25FromDiscord<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:39FromDiscord<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:49FromDiscord<Elegantbeef> Zig's strict variable usage has to be the most inane thing I've seen
05:23:09FromDiscord<spaceshaman> nim
05:23:11FromDiscord<spaceshaman> NIM
05:23:14FromDiscord<spaceshaman> I meant nim
05:23:20FromDiscord<spaceshaman> 3 letter pl names
05:23:54FromDiscord<spaceshaman> (edit) "zig" => "[edit] nim"
05:24:11FromDiscord<Elegantbeef> Too late I flamed Zig
05:24:49FromDiscord<spaceshaman> what is it?
05:25:13FromDiscord<spaceshaman> return values must be used?
05:25:22FromDiscord<Elegantbeef> A programming language
05:25:37FromDiscord<spaceshaman> wdym 'Zig's strict variable usage'
05:25:37FromDiscord<Elegantbeef> In Zig? Variables must be used
05:25:45FromDiscord<spaceshaman> oh ok
05:25:49FromDiscord<Elegantbeef> If they're not used you must annotate them `_bleh`
05:29:14FromDiscord<spaceshaman> bit of a nuisance
05:29:27FromDiscord<spaceshaman> where can I read about whats in the works for nim
05:29:47FromDiscord<spaceshaman> Like if they're working on better taged unions / sumtypes
05:30:15FromDiscord<spaceshaman> or optional types
05:30:15FromDiscord<Elegantbeef> Nim's RFC issue tracker
05:49:07FromDiscord<bubbly_avocado_86424> In reply to @Elegantbeef "Zig's strict variable usage": what do you mean by that?
05:49:38FromDiscord<Elegantbeef> Zig requires you to prefix with an underscore if a variable is not used and errors if you do not
06:20:58FromDiscord<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:46FromDiscord<ayex> on my machines when something is not used, that is only a warning by the nim compiler.
06:29:13FromDiscord<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:43FromDiscord<Elegantbeef> Yea it's not an error in Nim
06:41:36*disso-peach quit (Quit: Leaving)
06:43:28FromDiscord<bubbly_avocado_86424> yeah, i may've not paid adequate attention there
06:58:24FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=qFcFLbod
06:58:56FromDiscord<Elegantbeef> Why are you using the shell to get the md5 sum of something?
06:59:13FromDiscord<TFed> is there a function for it?
07:00:17FromDiscord<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:12FromDiscord<TFed> Oh🤔\: Note\: In order to use this module, run `nimble install checksums`
07:05:19FromDiscord<TFed> i will try it
07:07:15FromDiscord<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:29FromDiscord<ayex> oh wait, nvm\: it does not seem to have md5 - I used it for sha256.
07:08:58FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300354696459980811): i will try it↵↵https://nim-lang.org/docs/md5.html
07:09:46FromDiscord<TFed> yup for each package (in my package manager) i need hash
07:10:52FromDiscord<TFed> well, I just use it for ID, i can change to sha256 later
07:13:58FromDiscord<ayex> sent a code paste, see https://play.nim-lang.org/#pasty=PKMzlfnC
07:15:53FromDiscord<Elegantbeef> Hmph no way to stream it automagically
07:16:06FromDiscord<Elegantbeef> Shame that one has to load it all into memory
07:16:09FromDiscord<ayex> sent a code paste, see https://play.nim-lang.org/#pasty=UmfJdpdu
07:16:33FromDiscord<ayex> you can memory map also - it is shown in crunchy docs
07:17:32FromDiscord<ayex> sent a code paste, see https://play.nim-lang.org/#pasty=GAoifOjX
07:51:16FromDiscord<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:45FromDiscord<beetroit> Anyone using nim for Solana smart contracts yet?
08:49:25FromDiscord<gogolxdong666> for what
08:50:43*xet7 quit (Remote host closed the connection)
09:01:36FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=KzzrUSSZ
09:22:35FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=VYpItVav
09:22:35FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=xzHBAtwk
09:22:58FromDiscord<Elegantbeef> It's an issue with nimble
09:23:14FromDiscord<Elegantbeef> It's attempting to iterate the wrong thing of the json file
09:25:12FromDiscord<TFed> \~/.nimble/packages\_official.json has\:↵`{}`
09:27:02FromDiscord<k0ts> That file is supposed to contain an array of package infos
09:27:18FromDiscord<k0ts> You can delete it and get nimble to redownload it
09:31:11FromDiscord<TFed> it's empty
09:31:23FromDiscord<TFed> i have to rm, and then nimble update?
09:32:15FromDiscord<k0ts> nimble refresh, yeah
09:33:00FromDiscord<k0ts> Though it's not normal that that file got like that in the first place
09:35:49FromDiscord<TFed> it's my fault 😄 I just skipped the installation of nimble
09:36:29FromDiscord<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:34FromDiscord<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:06anddamhowdy, how would I start in order to targetting STM32 microcontrollers with nim?
09:45:08anddamI am looking this small project https://github.com/mwbrown/nim_stm32f3/blob/master/nim.cfg
09:46:20anddamseems 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:49anddamcan 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:39FromDiscord<TFed> yup, after `nimble install nim` everything works now
10:43:59FromDiscord<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:10FromDiscord<ayex> sent a long message, see https://pasty.ee/yhZtFyjW
13:01:51*beholders_eye quit (Quit: WeeChat 4.1.2)
13:03:14anddamthx both
13:03:27anddamI also found this with useful hints https://www.mail-archive.com/[email protected]/msg17733.html
13:14:13*beholders_eye joined #nim
13:15:52FromDiscord<ayex> sent a code paste, see https://play.nim-lang.org/#pasty=hFrOpBge
13:16:08FromDiscord<ayex> sent a code paste, see https://play.nim-lang.org/#pasty=aZiOVTui
13:20:22FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#pasty=cFvzIZxD
13:22:54FromDiscord<ayex> [michaelb.eth](https://matrix.to/#/%40_discord_383034029135364096%3At2bot.io) that is it - thank you! 😀
13:25:02FromDiscord<ayex> although it seem it cannot be combined with fmt"" ?
14:07:38FromDiscord<TFed> sent a code paste, see https://play.nim-lang.org/#pasty=TrbZCTLQ
14:10:04FromDiscord<TFed> is it illigal to have config/ for configs, lib/ for modules and src/ for sources of programms?
14:10:51FromDiscord<ayex> it is currently just a warning.↵↵if you setup your projects up with `nimble init` you should be good to go.
14:11:27FromDiscord<TFed> in the future it won't be allowed?
14:11:53FromDiscord<TFed> in the future it will be not allowed?
14:12:16FromDiscord<k0ts> I was under the impression that recent versions of nimble have removed that warning
14:13:34FromDiscord<TFed> so it's better to have a single directory for sources? even if i have configs separately...
14:25:03FromDiscord<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:41FromDiscord<TFed> 😕 I already in panic rewrote code↵(@k0ts)
14:34:36FromDiscord<TFed> sent a long message, see https://pasty.ee/vfVUdYlN
14:34:51FromDiscord<TFed> sent a long message, see https://pasty.ee/dEOAmEEr
14:35:02FromDiscord<TFed> srs/upman/srs🤣
14:35:21FromDiscord<TFed> src/upman/src🤣
14:35:46FromDiscord<TFed> i will revert back, that warning forced me to make everything worse
14:38:54FromDiscord<TFed> sent a long message, see https://pasty.ee/GPWhEoIh
14:43:29FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300468058045026305): i will revert back
15:06:31FromDiscord<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:34FromDiscord<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:45FromDiscord<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:25FromDiscord<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:32FromDiscord<Robyn [She/Her]> In reply to @TFed "[Edit](https://discord.com/channels/371759389889003": you're writing a pkg manager?
17:54:13FromDiscord<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:48FromDiscord<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:48FromDiscord<TFed> i just wanna use it
18:19:48FromDiscord<TFed> i just wanna use it, if i need that in my package manager
18:26:55FromDiscord<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:09FromDiscord<morgan (ping with reply)> i suppose i could just print out a table
18:28:37FromDiscord<morgan (ping with reply)> ok yea original ascii
18:28:55Amun-Rachar is almost just an octet
18:29:44FromDiscord<morgan (ping with reply)> the top bit is unused, like with og ascii
18:30:02FromDiscord<morgan (ping with reply)> the others extend it to 8 bits
18:30:15Amun-Ralet s = "\xff"
18:30:24Amun-Raperfectly valid, top bit is used
18:30:40Amun-Rahttps://nim-lang.org/docs/tut1.html#basic-types-characters
18:31:59FromDiscord<morgan (ping with reply)> ok the encoding echo uses with char/string
18:32:35Amun-Raecho outputs octets, they are interpreted by the terminal
18:33:06FromDiscord<michaelb.eth> In reply to @morganalyssa "anyone know what encoding": wat?
18:33:39Amun-Rachar is like a distinct byte
18:34:11FromDiscord<michaelb.eth> exactly, the question doesn’t make sense
18:34:17FromDiscord<morgan (ping with reply)> ok i wasn't sure if it converted to a consistent encoding to output to, fair enough
18:34:32FromDiscord<morgan (ping with reply)> i guess terminals don't necessarily support unicode
18:35:13Amun-Radefault encoding in my terminal emulator is utf-8, echo "\xc5\xba" will output 'ź;
18:36:07FromDiscord<michaelb.eth> this stuff can get tricky to understand: character set vs encoding vs locale, and how those things relate
18:36:08FromDiscord<morgan (ping with reply)> ah ok then i guess it's just on my end then
18:37:31Amun-Rastrings are generally considered to be utf-8 encoded
18:37:47FromDiscord<michaelb.eth> the char that make up a Nim string are essentially just bytes, and usually you’re dealing with utf-8
18:37:57Amun-Raif you'd like to iterate over utf-8 runes see std/unicode
18:39:36FromDiscord<morgan (ping with reply)> im just doing some visual debugging
18:40:09FromDiscord<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:40FromDiscord<bubbly_avocado_86424> sent a long message, see https://pasty.ee/eciRWafF
20:14:09FromDiscord<Elegantbeef> Variables can be but into arrays but it copies them
20:14:09FromDiscord<Elegantbeef> be put\
20:14:43FromDiscord<bubbly_avocado_86424> okay, then what is recommended to have a list of objects ?
20:15:25FromDiscord<Elegantbeef> Use a sequence
20:19:20FromDiscord<bubbly_avocado_86424> the irony, i had worked with a sequence, then decided on a register of objects↵will try
20:24:10FromDiscord<TFed> what is `tests/config.nims``switch("path", "$projectDir/../src")`
20:24:12FromDiscord<TFed> what is `tests/config.nims``switch("path", "$projectDir/../src")` ?
20:24:24FromDiscord<TFed> what is this in `tests/config.nims`\:`switch("path", "$projectDir/../src")` ?
20:25:06Amun-Rait adds src path for tests
20:25:10FromDiscord<TFed> switch moves you into dir with libs, or appends PATH with source dirs?
20:25:25FromDiscord<TFed> so i can add one pathes?
20:25:27FromDiscord<TFed> cool
20:25:31Amun-Rasure
20:25:34FromDiscord<Elegantbeef> `switch` is just a compiler switch
20:25:44FromDiscord<Elegantbeef> `path` is how Nim find's `.nim` files
20:25:49FromDiscord<TFed> a so "path" is actually a command
20:25:58Amun-Rapatch is a switch
20:26:13Amun-Raswitch "path", "foo" is an equivalent of --path=foo
20:26:47Amun-Ras/patch/path/
20:28:14FromDiscord<TFed> thanks
20:28:15FromDiscord<TFed> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1300556147085807700): a so "path" is actually a command to append pathes
20:28:39FromDiscord<Elegantbeef> On the command line it'd be `--path:"$projectDir/../src"`
20:29:25FromDiscord<TFed> i got it, okay
20:35:25*ntat quit (Quit: Leaving)
20:54:02FromDiscord<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:15FromDiscord<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:32FromDiscord<Elegantbeef> Should be the entry to the program
20:54:34FromDiscord<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:50FromDiscord<Elegantbeef> hence why it's `$projectDir/../`
20:55:05FromDiscord<Elegantbeef> It's a file in `tests` which means you need to do `../`
20:56:32FromDiscord<TFed> so in this case projectDir is a tests and with .. i got to the parrent dir
20:56:36FromDiscord<TFed> so in this case projectDir is a tests and with .. i got to the parent dir
20:56:40FromDiscord<Elegantbeef> Yes
20:56:43FromDiscord<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:17Amun-Rayes
21:36:09FromDiscord<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