Re: libgcc_s_dw2-1.dll dependency

2020-06-28 Thread LeFF
I think it was statically linked before, try passing '-static' to linker or something.

Re: LSP client for VSCode

2020-06-28 Thread LeFF
Is nimlsp kinda new thing? I've been using this extension and had no troubles doing as of yet: [https://marketplace.visualstudio.com/items?itemName=kosz78.nim](https://marketplace.visualstudio.com/items?itemName=kosz78.nim)

Re: New article about Nim meta-programming in Russian

2020-06-20 Thread LeFF
Well, yes it is easier. I tried using times module for that, but sadly it failed to compile. I think it is a bug, as I can see no real reason why times module can't be used at compile time. On the other hand using random at compile time that I made for the article seems easier than modifying the

Re: New article about Nim meta-programming in Russian

2020-06-20 Thread LeFF
[https://forum.nim-lang.org/t/1305](https://forum.nim-lang.org/t/1305) \- here you go.

Re: New article about Nim meta-programming in Russian

2020-06-20 Thread LeFF
Actually I gave him an idea to use term rewriting macro for that if you dig up his forum post here before the library was released.

New article about Nim meta-programming in Russian

2020-06-20 Thread LeFF
Hey! I've just wrote an article about how to use Nim's powerful metaprogramming features for simple code obfuscation. The text is in Russian language, but the code is pretty self explanatory. Here is the link: [https://wasm.in/blogs/meta-programmirovanie-nim-i-obfuskacija.706](https://wasm.in/bl

Re: Has anyone wrapped zlib or reimplemented deflate?

2020-06-19 Thread LeFF
I think we should pick up quite a few stable c libraries (MIT or Apache licenced), make ideomatic Nim wrappers, make it a part of Nim's standard library and distribute it with Nim's compiler. Zlib, MbedTLD are good candidates and compression, encryption, https and etc is good to have in a base

Re: Nim version 1.2.2 is out!

2020-06-18 Thread LeFF
That's great, thank you!

Re: Nim version 1.2.2 is out!

2020-06-17 Thread LeFF
Talking about SSL, do we still depend on OpenSSL for HTTPS clients? Is there a somewhat easy way to swap it out for something like Mbedtls?

Re: Transform procs at compile time?

2020-06-15 Thread LeFF
I think that it should be more easily done from NimScript, it seems that macros module is supported in NimScript. I think I can write a script that processes modules to a temp folder and then compile them from NimScript. What do you think?

Re: Transform procs at compile time?

2020-06-15 Thread LeFF
I don't quite get it. For example I have a few modules that I want to process. I will need to use staticRead for each file, use parseStmt to get the AST, transform it and what do I do next? Do I need to save this modules to a temp folder using astGenRepr and add them to the compilation pipeline?

Transform procs at compile time?

2020-06-15 Thread LeFF
Is there a way to get the AST for all procs of a module and apply some transformation on it at compile time. I've been looking at this [https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim](https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim) \- here the code uses te

Re: "If you need an embedded C compiler" - from the latest zig blog includes an suggestion for Nim

2020-03-24 Thread LeFF
As far as I know it doesn't really cross compile to Mac OSX, but yes, Linux and Windows targets seems to be well supported. One could also try musl.cc cross compilers, if cross compilation to different Windows and Linux targets needed.

Re: Zig as C compiler for Nim. How to feed him the code

2020-02-19 Thread LeFF
Yeah, sure, but you need to build one yourself on Windows for example, Zig does it out of the box. There is no GCC built and ready to cross compile from Windows to Linux or Mac. There is musl.cc, but it is buggy as hell.

Re: Zig as C compiler for Nim. How to feed him the code

2020-02-18 Thread LeFF
Zig can crosscompile C code and even let you choice if you want to link against glibc or musl on any linux based targets.

Re: Nim custom Lua backend?

2020-02-09 Thread LeFF
So is there any tutorials on how to add a custom pass to the compiler? Do we need to rebuild the compiler when the pass is implemented and registered in the compiler's passes chain? Or maybe passes can be implemented as external dll/so and added to the compiler via command line (like GCC plugins

Re: Compile-time string obfuscation

2020-01-12 Thread LeFF
I wonder if it is possible to apply the encryption code to a module automatically, so that it won't be needed to mark all strings with "xs". I was trying something like that few years ago, I even created a topic about it on the forum I believe, but I don't remember how it all ended.

Re: Compile-time string obfuscation

2020-01-12 Thread LeFF
I found it: [https://forum.nim-lang.org/t/338](https://forum.nim-lang.org/t/338)

Re: Embedding libclang into Nim's compiler

2020-01-04 Thread LeFF
> Note that we already ship Nim with GCC on Windows. Mac OS already mostly > comes with clang and Linux also will have GCC/clang installed via a package > manager. Not sure there is much benefit in shipping this dependency on > Linux/Mac. Yes, but installing C/C++ cross compilers and cross link

Embedding libclang into Nim's compiler

2020-01-04 Thread LeFF
Hello! Bare with me here. Recently I've been watching Zig programming language development streams. One of the thing that was very surprising to me is that Zig compiler embeds libclang and also minified versions of glibc, musl and mingw. That way Zig compiler can automatically import C code head

Is it possible to use MbedTLS for HTTPS instead of OpenSSL?

2019-11-12 Thread LeFF
I need to write HTTPS client application, but I'd like to use MbedTSL (statically linked) for SSL/TLS support instead of OpenSSL. How can I hook it up so that Nim's HTTP protocol implementation would use MbedTLS? Thanks!

Re: 1.0.0 is here

2019-09-25 Thread LeFF
Discussion on the Dlang forums: [https://forum.dlang.org/thread/hsvbknmmwgspnkfvf...@forum.dlang.org](https://forum.dlang.org/thread/hsvbknmmwgspnkfvf...@forum.dlang.org)

Re: Modify AST at compile time?

2019-09-25 Thread LeFF
I'm sorry, I've read the thread you've posted link to, but how this thing eventually ended? Was the wrapwith statement introduced? Or is there any alternative that will be useful for me?

Re: WinCon vs 1.0.0

2019-09-24 Thread LeFF
I was wondering if using the WCHARs instead of CHARs may fix the issue? On Windows it always better to go Unicode way, instead of ANSI way, as the kernel itself in Unicode based. For example you could directly use _putws to output unicode strings.

Re: Modify AST at compile time?

2019-09-24 Thread LeFF
I don't quite get it, there is an attribute macro for example, it can transform the AST for functions that the attribute is assigned to. Is there a way to assign the attribute to the whole module? And to all modules that is being compiled with my project, including the Nim's stdlib?

Modify AST at compile time?

2019-09-24 Thread LeFF
Hello! Sorry if my question is too obvious, I'm still new to Nim. I know Nim is great at metaprogramming stuff. Is it possible to get and transform the AST of all compiled modules at compile time? Basically I want to inject some custom code to the begining and to the end of all functions (includ

Re: 1.0.0 is here

2019-09-24 Thread LeFF
That's great news! Thanks to all the people involved!

Re: Nim vs V language

2019-06-29 Thread LeFF
In the meanwhile the V language was released to github. Which is quite funny. A lot of people gets upset not seeing bold claims actually being well implemented. [https://github.com/vlang/v/issues/35](https://github.com/vlang/v/issues/35)

Re: Nim Compilation Speed?

2019-06-28 Thread LeFF
I believe right now Red isn't self-hosted, it uses old Rebol interpreter (which has no JIT or any other tech to make it run fast) to run the compiler, so 4 minutes to compile 35k lines of code is pretty understandable. The other thing about Red is that it is a pretty naive compiler, it only gene

Nim and DLLs?

2019-06-27 Thread LeFF
I remember there was some trouble when doing windows DLLs in Nim. Some issue with GC not being properly initialized or something. I couldn't find any info about this in Google. Could you please clarify if the issue still exists, what is it all about if it does or did exist. Thanks!

Re: Troubles with installing VSCode Nim extension.

2019-05-20 Thread LeFF
Eventually I've installed the old 0.5.29 version of extension, 0.6+ versions aren't working fro me.

Troubles with installing VSCode Nim extension.

2019-05-17 Thread LeFF
I've tried installing extension for VSCode from VSIX. I'm in offline environment, so I download VSIX and install it from file. However Nim extension failed to install with quite cryptic log messages: [2019-05-14 15:56:43.211] [sharedprocess] [info] main {"machineId":""} [2019-0

Re: How to set toolchains for cross compilation?

2019-05-16 Thread LeFF
So I finally managed to make it work. test.nim: echo "Hello World!" Run test.nim.cfg: gcc.path = r"C:\COMPILERS\x86_64-w64-mingw32-native\bin" gcc.exe= "x86_64-w64-mingw32-gcc.exe" gcc.cpp.exe= "x86_64-w64-mingw32-g

Re: How to set toolchains for cross compilation?

2019-05-14 Thread LeFF
What are you too talking about? I'm on Windows and I have all C toolchains working as expected. I can't make Nim compiler use the right toolchain for each of four targets, it uses gcc.exe for some reason. Please read the post before answering.

How to set toolchains for cross compilation?

2019-05-14 Thread LeFF
So okey, I'm on windows, I have 4 toolchains in PATH: * i686-w64-mingw32-gcc.exe - targeting native Windows i686 * x86_64-w64-mingw32-gcc.exe - targeting native Windows x64 * i686-linux-musl-gcc.exe - targeting Linux i686 from Windows * x86_64-linux-musl-gcc.exe - targeting Linux x64 from

Re: Nim vs D

2019-05-06 Thread LeFF
Yes, but the DMD's fronend version in GCC 9.1 is like 8 versions behind the current one, this is kinda bad. On the other hand there were Java and Python frontends on the GCC, and where are they now? I think only Ada and Fortran frontends are really good GCC citizens along side with C/C++/ObjC.

Re: Nim vs D

2019-04-25 Thread LeFF
People in the D community is actively discussing if D has failed: [https://forum.dlang.org/thread/ylwktmssgntvoddub...@forum.dlang.org](https://forum.dlang.org/thread/ylwktmssgntvoddub...@forum.dlang.org) It is kinda interesting and frustrating to see how big and old living project being pushed

Re: getch() vs Cyrillic on Windows.

2019-04-08 Thread LeFF
CP866 is usually used for console programs on Russian version of windows (which is OEMCP), and CP1251 is usually used for gui programs on Russian version of Windows (which is ACP). Technically I don't really see any reason why this shouldn't be working with char types. However I would rather be

Re: similar language

2019-04-07 Thread LeFF
Being a much simpler language FreeBasic may be fast (having no GC for example), but I bet it won't be reasonably faster than Nim. I don't really see why now anyone would choice FreeBasic over Nim, D, Rust or any other modern alternative.

Re: Nim vs V language

2019-04-03 Thread LeFF
There is nothing to talk about until the reference compiler is released. "Talking is cheap, show me the code" (c)

How do I create a thread from COM-plugin?

2018-07-18 Thread LeFF
So I have a COM-dll written in Nim, it implements some interface. The host application is written in C++ and loads my plugin written in Nim via COM. Eventually the host app calls my on_connection method passing me the IDispatch interface pointer so I could communicate with the host app. So in on

Cross-compilation?

2018-01-19 Thread LeFF
I'd like to cross-compile Nim code on Windows machine to some generic Linux distribution and Mac OSX machines both i386 and x86_64. Well Nim seems quite good in cross-compiling in terms of C source code generation. But to generate target executables I need a C cross-compiler toolchain. Has anyo

Re: What happened to term rewriting macro?

2017-07-30 Thread LeFF
@bpr, oh, it is in the manual now, I somehow missed it... sorry for that!

Re: What happened to term rewriting macro?

2017-07-29 Thread LeFF
@LeuGim, I found old documentation, made an example and I see it working now, but I don't see any documentation about it... I thought maybe it is going to be deprecated or even removed completely at some point near 1.0 release or something... but to be fare it is a very neat feature, that I'm go

Re: Working with ZIP files

2017-07-29 Thread LeFF
try out miniz: [https://github.com/richgel999/miniz](https://github.com/richgel999/miniz) \- it is single file C-library, which can read/write zip files... I'm not sure if there is a ready to use Nim bindings, but it should be easy to make one yourself...

What happened to term rewriting macro?

2017-07-29 Thread LeFF
It seems that there is no documentation about it, but I remember that it was years ago. Was it removed from Nim compiler at some point?

Nim video tutorials

2017-02-25 Thread LeFF
Hello! I want to make a video tutorial series about Nim and post it to my youtube channel and I want to do it for two main reasons: 1. in my opinion Nim doesn't get as much attention as it should 2. it seems that we still don't have any video tutorials about the language But before doing i