26 Jun 2022 |
Isofruit#5120 | Other than that, there's wiki pages detailing comparisons between nim and python/c: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers | 16:54:33 |
| ܕܵܢ changed their display name from Izazo M. Squoze to ܕܵܢ#8554. | 17:24:32 |
| ܕܵܢ changed their profile picture. | 17:24:40 |
| ܕܵܢ changed their display name from ܕܵܢ#8554 to ܕܵܢ. | 17:24:44 |
deadmeme77 | Ah, this is an important concept that I need to get, I guess | 19:10:23 |
deadmeme77 | "In C, there's nothing that stops you from keeping a pointer to a stack-allocated array after the function that declared it has returned (and the stack is invalidated). In Nim, this is true as well, but you are strongly discouraged from using pointers in Nim, and you can accomplish almost everything you'd otherwise use pointers for with normal arguments, "var" arguments, variables, and "ref"." | 19:10:25 |
deadmeme77 | so in C codes that use pointers, I should check whether to replace them with normal arguments, or references | 19:11:05 |
Elegantbeef | In reply to @_discord_705152179782025308:t2bot.io Why does overloading is work inside the file where its defined, but not in another file where it gets imported? Given the purpose of is overriding it is suspect at best | 20:28:26 |
Elegantbeef | is is meant to be used for compile time type checking for generics and similar, overriding it does not make any sense to me | 20:29:53 |
Elegantbeef | In reply to @_discord_768775480168939521:t2bot.io so in C codes that use pointers, I should check whether to replace them with normal arguments, or references Yep the best Nim code uses ptr s only where they're absolutely needed(typically with C interop) otherwise you use safer tools | 20:30:51 |
| void09[IRC]#0000 joined the room. | 21:50:53 |
void09[IRC]#0000 | whoami | 21:50:54 |
| voidwalker09 joined the room. | 21:51:32 |
voidwalker09 | sorry | 21:52:35 |
demotomohiro | If you are using pointer or addr but not using C library/API, you are very likely doing something wrong. | 22:33:03 |
Patitotective | why do enums and object collide? shouldn't i just have to write MyEnum.MyObj to refer to the enum?
type
MyEnum = enum
MyObj
MyObj = object
x, y: int | 23:18:02 |
Elegantbeef | You can annotate the enum with {.pure.} or use overloadableEnum s | 23:20:43 |
demotomohiro | For example:
type
MyEnum {.pure.} = enum
MyObj
MyObj = object
x, y: int | 23:21:14 |
Elegantbeef | Having a type named the same as an enum field is bad practice anyway | 23:22:08 |
Elegantbeef | Overloadable enums doesnt solve the problem though | 23:23:22 |
Elegantbeef | Thought it would, but it doesnt | 23:23:29 |
Patitotective | im translating some cpp code to nim (3k lines 😭 ) so i guess i'll reconsider all names when i get it working ;] | 23:23:47 |
Elegantbeef | What're you translating? | 23:24:05 |
Patitotective | https://github.com/BalazsJako/ImGuiColorTextEdit 😶 | 23:24:50 |
Elegantbeef | You do realize the .h file is only 300 loc right? | 23:27:02 |
Patitotective | yeaaa but i dont want to wrap it | 23:27:44 |
Elegantbeef | Then have fun | 23:27:55 |
Patitotective | and i dont know how to compile it either | 23:28:03 |
Patitotective | :/ | 23:28:07 |
27 Jun 2022 |
NimEventer[IRC]#0000 | New thread by Treeform: Nim 2.0 is already here., see https://forum.nim-lang.org/t/9266 | 00:00:55 |