Re: similar language

2020-01-23 Thread Libman
> Admin note: I removed an offtopic post.

Kinda arbitrary. This topic bounced between several different languages and how 
they compare to Nim. Vlang was mentioned on this thread before without getting 
censored, but my mention of it just appearing on TechEmpower was censored.

Inconsistent use of power is bad politics... 


Re: similar language

2020-01-22 Thread Libman
Vlang's pico framework has just burst into [the latest TechEmpower 
JSON](https://www.techempower.com/benchmarks/#section=test&runid=7f65c127-fad2-4a88-a6cb-5333c68362ef&hw=ph&test=json)
 and 
[Plaintext](https://www.techempower.com/benchmarks/#section=test&runid=7f65c127-fad2-4a88-a6cb-5333c68362ef&hw=ph&test=plaintext)
 benchmarks, the same ones that still feature httpbeast.

The race is on.


Re: Naming conventions - need leading underscore

2020-01-16 Thread Libman
According to the upcoming Official 21st Century Universal Code Style Guide, the 
correct way to write this is:


type
Euler* = object
💩x, 💩y, 💩z, 💩a, 💩b. 💩c: float64

method x( this: Euler): float64 =
return this.💩x


Run

Leading and trailing underscores aren't allowed, for good reason. But pretty 
much all other unicode characters are a-OK. All popular Nim code editors have 
plugins for easy emoji insertion. Then you just need to pick a character that 
best expresses "don't touch this". 


Re: Arraymancer - v0.4.0 (May 2018)

2020-01-10 Thread Libman
Very impressive matmul results in [Kostya's 
benchmarks](https://github.com/kostya/benchmarks).

Would be even better if s/Apache/MIT/ license... 


Re: Tables or seq

2019-12-28 Thread Libman
We cannot help without more details. What database / database library / ORM are 
you using? How does it treat 
[Table](https://nim-lang.org/docs/tables.html#Table) objects differently from 
seq? If it's an SQL database, what SQL does it execute? Etc.


Re: What’s your favorite programming language and why?

2019-12-19 Thread Libman
Shell scripting. (I use `mksh`, slowly thinking of transitioning to `zsh`.) I 
find myself being able to do a huge fraction of my tasks with just shell, 
common Unix tools, and some very useful new command line tools (ex `jq`, 
`curl`, etc). I make heavy use of running `$EDITOR` (ex `vim` or `kakoune`) on 
a temp file for user interaction (ex selecting from SQL database into YAML, 
then using a tool that parses saved file and updates the DB).

But obviously you need a systems language for writing such lean, fast, reusable 
tools, and I think Nim or D are the best candidates.


Re: Nim programme language

2019-12-12 Thread Libman
Please use more descriptive thread subjects. All of this forum is about "Nim 
programm[ing] language".


Re: Comparing languages by their popularity with their Rosetta Code implementation terseness.

2019-12-12 Thread Libman
It would have been great if Rosetta Code (or a blatant scrape thereof) would 
let people rate the aesthetic qualities of a correct implementation. No measure 
is perfect, but that would be more valuable than calculating code "terseness".

(I hate to endorse a proprietary evil powerhouse like GitHub, but having users 
log in with their accounts there, would even allow weighing or discarding votes 
based on their stars. Sites like IMDB do something similar to weigh user 
reviews.) 


Re: Editor support for Nim 1.0

2019-12-12 Thread Libman
vscode or nvim ought to be enough for everybody. 


Re: Recommended GUI library?

2019-12-11 Thread Libman
Minimalists and license purists go 
[nuklear](https://github.com/zacharycarter/nuklear-nim). 


Re: How to properly use Proxies in Nim

2019-12-11 Thread Libman
I get the same error message even from `nimble update` and `choosenim` when 
trying to run over an SSH proxy with `export http_proxy=socks5://0:8123`...


Re: Comparing languages by their popularity with their Rosetta Code implementation terseness.

2019-12-11 Thread Libman
I'm a big fan of programming language comparisons, and I'm happy to see one 
trying to measure terseness.

I personally would measure terseness by first stripping out comments and empty 
lines, normalizing all identifier names to same length, and then counting 
characters weighed by typing effort (ex. 1.0 for lowercase, 1.2 for numbers, 
1.4 for uppercase, 1.6 for punctuation, 3.5 for unicode, 5.0 for line break). 
This would adequately punish $perl, P_H_P, and especially languages that make 
you type "endnendnend". 😏

But it doesn't make sense to me to graph two totally disconnected things, 
popularity and terseness, as the X and Y axis of the same graph.

It would make more sense to graph two things where there's a trade-off between 
them, like:

  * Terseness vs CPU Time
  * Terseness vs Compile Time
  * Terseness vs Memory Usage



Then you could cluster languages into categories: highest-performance with 
high-effort, lowest-effort with low-performance, unrewarded verbosity, and the 
contest to find the language that provides highest maximization of both (which 
is where Nim would excel).

It would also be interesting to compare different popularity rankings against 
each-other, like [TIOBE](https://www.tiobe.com/tiobe-index/) (which 
approximates Web content quantity) vs [PyPL](https://pypl.github.io/PYPL.html) 
(Google Trends) vs [Module Count 
Growth](https://old.reddit.com/r/nim/comments/dyeklg/nimble_goes_up_to_11_hundred/)
 vs specific community counts (GitHub [Pull 
Reqs](https://madnight.github.io/githut/#/pull_requests/2019/3) / 
[Pushes](https://madnight.github.io/githut/#/pushes/2019/3) / 
[Stars](https://madnight.github.io/githut/#/stars/2019/3) / 
[Issues](https://madnight.github.io/githut/#/issues/2019/3), Reddit headcount, 
[IRC](https://netsplit.de/channels/?net=freenode), StackOverflow, etc). If some 
of the latter measure early adopter enthusiasm, then that can be used to 
predict future mainstream popularity growth. 


Re: How to Maintain a Nim Chinese Community

2019-12-02 Thread Libman
Of course the main gateway is banned, but people [can 
still](https://www.reddit.com/r/ipfs/comments/b0oe37/sending_files_to_china_via_ipfs/)
 use it over VPN, I2P/Tor gateways, etc.


Re: Nim is the friendliest language to start

2019-12-02 Thread Libman
> Web framework [https://nimwc.org/login](https://nimwc.org/login)

[Not free software.](https://forum.nim-lang.org/t/4703)


Re: Nim @ Wikipedia

2019-10-24 Thread Libman
I added Nim to the ["Use as an intermediate 
language"](https://en.wikipedia.org/wiki/JavaScript#Use_as_an_intermediate_language)
 listing on the "JavaScript" article. Each list item there contains a name of 
the language that can compile to JavaScript with a one-sentence description of 
the language.

I was thinking of copying the first sentence on top of the ["Nim (programming 
language)"](https://en.wikipedia.org/wiki/Nim_\(programming_language\)) article:

> **Nim** (formerly named **Nimrod** ) is an imperative, general-purpose, 
> multi-paradigm, statically typed, systems, compiled programming language 
> designed and developed by Andreas Rumpf.

But that seemed overly verbose, and lacking what may be the most interesting 
detail, so on the JS article I instead used:

> Nim, a general-purpose, multi-paradigm, statically typed, system programming 
> language with a Python-like syntax that can compile to JavaScript in addition 
> to C/C++.

(There's also a similar ["Other languages that compile to JavaScript 
"](https://en.wikipedia.org/wiki/CoffeeScript#Other_languages_that_compile_to_JavaScript)
 listing on the "CoffeeScript" article that maybe needs to be removed.)

This is a very minor thing, but the purpose of this thread is to log 
Nim-related Wikipedia changes we make so they can be more easily reviewed by 
the rest of the Nim community.


Re: Anyone here used Nim with JUCE?

2019-10-22 Thread Libman
> JUCE is not a GUI library. It is a specialized toolkit for 
> audio/video/DSP/plugins/MIDI software creation which also includes some GUI 
> support.

OK, I guess this means that Qt-related audio libraries (ex. 
[SigDigger]([https://github.com/BatchDrake/SigDigger)](https://github.com/BatchDrake/SigDigger\)),
 
[QMidi]([https://github.com/waddlesplash/QMidi)](https://github.com/waddlesplash/QMidi\)),
 etc) aren't as good?

> There's nothing bad in dual licensing. Qt still has dual license 
> ([https://www.qt.io/licensing/)](https://www.qt.io/licensing/\)).

I guess you didn't read what I said closely. Which license is involved (GPL or 
**L** -GPL) matters a great deal. This was [of particular concern for 
KDE]([https://kde.org/community/whatiskde/kdefreeqtfoundation.php)](https://kde.org/community/whatiskde/kdefreeqtfoundation.php\)),
 and there was an agreement in place for Qt to be released as BSD if abandoned.

I mentioned licenses only in describing how JUCE compares for most people. 
People are less likely to invest time adding Nim support to a large framework 
they can't use in all circumstances due to legal restrictions. 


Re: I dunno what's so hard to understand about it.

2019-10-19 Thread Libman
> the project leader has a veto right over community

I just want to emphasize this point. It's Araq's toy, he can do whatever he 
wants. Choosing to use his Nim is our voluntary choice. If someone's not happy, 
they can create a fork.


Re: similar language

2019-10-19 Thread Libman
[Kostya's benchmarks](https://github.com/kostya/benchmarks) is finally back to 
life, and they just added Vlang. I don't know the details, but the current 
results are hilarious! 😁

While we're on the subject of joking about other languages, [much D lols on 
Reddit](https://old.reddit.com/r/programming/comments/di954b/vision_of_ds_future/f3v5dub/?context=3).

(Sorry, couldn't resist. This thread will probably get locked [as 
well](https://forum.nim-lang.org/t/4758).)


Re: Nim for enterprise software development

2019-10-19 Thread Libman
"SQLite for single-user apps and PostgreSQL when you need it" ought to be 
enough for everybody. 


Re: Winning the Base64 benchmarks.

2019-10-16 Thread Libman
> benchmarks are a game.

I agree, but in a very positive interpretation of that phrase.

Competitive games are essential, both to individual human development as well 
as software projects. They are a feedback mechanism that challenges potential 
complacency, and helps bring out the best that is within us.

Even if benchmarks don't have a perfect correlation with every real-world 
performance scenario, they have a strong correlation with many. Participating, 
tuning, and winning benchmarks shows that Nim has a community that cares about 
its success. 


Re: Rewrite daemonic CMS to NIM?

2019-10-15 Thread Libman
1\. PHP is a horrible language by every measure.

2\. Scripting languages [scale very 
poorly](https://www.techempower.com/benchmarks/#section=data-r17&hw=cl&test=json)
 on the server end.

3\. The name of the programming language is "Nim", not "NIM", which implies 
it's an initialism. (* Calling it < **N** >ew < **I** >mproved < **M** >odula-3 
was a joke. *)

4\. Regular JS (as generated by Nim's JS backend) still has some advantages 
compared to WebAssembly... 


Re: Nim for enterprise software development

2019-10-15 Thread Libman
> Delphi has now the ability to run its code and GUI's on multiple platforms. 
> In a study Delphi had 70% of the speed of Microsoft visual c++ compiler. But 
> Delphi's compiler is lightning fast, it is almost like python in that sense. 
> Delphi also has an amazing RAD development package and is easy to learn and 
> use.

Nim is far ahead of Delphi in portability, syntax efficiency, and license 
freedom. I don't see Delphi in any popular benchmarks. I'd like to see specific 
numbers on compile time, static executable size, CPU performance, [server 
scalability](https://www.techempower.com/benchmarks/#section=data-r17&hw=cl&test=json),
 etc.

Qt Studio with closer Nim integration would be a lot better RAD than Delphi...


Re: Anyone here used Nim with JUCE?

2019-10-15 Thread Libman
Someone is yet to write a JUCE library for Nim.

Out of curiosity, what made you choose JUCE over [the 
alternatives](https://en.wikipedia.org/wiki/List_of_widget_toolkits)?

JUCE has a big down-side of being [GPLv3/commercial 
licensed](https://github.com/WeAreROLI/JUCE/blob/master/LICENSE.md), and thus 
not very popular. The two most popular portable GUI choices, Qt and GTK both 
use **L** -GPL. But I think Nim can do even better by focusing on something new 
and genuinely free...

Related:

  * [Making a Cross-Platform App in 
$currentYear](https://blog.budgetwithbuckets.com/2018/12/13/making-an-app-2018.html)
  * [Cross-Platform GUI Toolkit 
Trainwreck](https://blog.johnnovak.net/2016/05/29/cross-platform-gui-trainwreck-2016-edition/)




Re: I think we can really do better...

2019-10-15 Thread Libman
[Kostya's benchmarks](https://github.com/kostya/benchmarks) have become updated 
again [after a long absence](https://github.com/kostya/benchmarks/issues/179), 
featuring Nim v1.0.0, Rust stable, the current versions of the D compiler trio, 
etc.

Nim's BF2 results have improved compared to [the 
past](https://archive.fo/8WJUb#selection-2157.0-2160.0): both Nim backends now 
beat Rust, and Nim-Clang now beats LDC.

There's still room for improvement in other tests. There's a new maintainer. 
Hope the Nim community will submit improved implementations.


Re: Great tutorials needed

2019-09-26 Thread Libman
I encourage everyone to BUY the book. 


Re: Great tutorials needed

2019-09-25 Thread Libman
> Is there any getting started tutorials for Nim?

In addition to what was mentioned above, the great **_Nim In Action_** book is 
available on BitTo^H^H^H^H^H ... err ... I mean ... It's available [on 
Amazon](https://www.amazon.com/Nim-Action-Dominik-Picheta/dp/1617293431)! And 
elsewhere.

> maybe video playlist on Youtube channel

I have one with currently [56 Nim-related videos 
(English)](https://www.youtube.com/playlist?list=PLXIivpcMlfwAevvA4IvLIiYOujqSuyyKY).

> Also with real-world examples.

There are 
[3476](https://api.github.com/search/repositories?q=language:nim&sort=stars) 
Nim repos on GitHub - hopefully some of them qualify as "real-world"... 


Re: How do nim users who have some proficiency in Lisp compare the two?

2019-09-25 Thread Libman
Really the only thing that Nim and Lisp have in common is very powerful 
metaprogramming. Aside from that - it's a very strange comparison...

Lisp is a family of programming languages, almost all of which are scripting 
languages without static typing. Most common Lisp implementations (ex. SBCL, 
and some might count Clojure) cannot produce lean high-performance executables, 
which is a big strength for Nim. [Kostya's 
benchmarks](https://github.com/kostya/benchmarks) show Nim being much more 
efficient than Lisp variants Racket and Chez Scheme.

Lisp is especially known for its peculiar 
[S-expression]([https://en.wikipedia.org/wiki/S-expression](https://en.wikipedia.org/wiki/S-expression))
 syntax, which now (adding up all Lisp and Scheme flavors) has less than 1% 
[market share](https://www.tiobe.com/tiobe-index/). A small minority of 
programmers like it, but the vast majority don't, and would probably find it 
difficult to read your code or contribute to your project. Nim's syntax 
philosophy is shared with Python (soon to become undisputed as the most popular 
scripting language), and so it's less peculiar than Lisp to people coming from 
other top programming languages.

Related: [Make a Lisp in Nim](https://hookrace.net/blog/make-a-lisp-in-nim/) 
(2015)


Re: [RFC] Why use Nim?

2019-09-25 Thread Libman
> Web framework with 2 Factor Authentication, ReCaptcha, WebP, Postgres/SQlite, 
> DbC, Hardened builds, etc.

[Subject to the Pol Pot License...](https://forum.nim-lang.org/t/4703) 🥺


Re: How to change C compiler globally on Linux?

2019-09-25 Thread Libman
Having a shared system-wide config file is useful in many Grandpa Unix 
scenarios, like shared [shell 
account](https://en.wikipedia.org/wiki/Shell_account) boxes. This is major 
retro nerd chic! 🐡 🧐

`nim` would be in `/usr/local/bin` on most BSDs, or `/usr/pkg/bin` or 
`/opt/pkg` on PkgSrc systems, etc.

[getSystemConfigPath](https://github.com/nim-lang/Nim/blob/4becd5a2a8d67c7481af457d5007e1a313d454c8/compiler/nimconf.nim#L225)
 could dig harder...


Re: [RFC] Why use Nim?

2019-09-24 Thread Libman
I think the question of "Why use Nim?" is incomplete without context. There 
should be several specific variants of this question, each with a somewhat 
different set of arguments:

  * Why use Nim to teach 
[CS101](https://www.i-programmer.info/news/150-training-a-education/7511-python-becomes-most-popular-cs-teaching-language.html)?
  * Why use Nim for mobile apps?
  * Why use Nim for desktop apps?
  * Why use Nim for desktop games?
  * Why use Nim for Web front-end?
  * Why use Nim for [Web 
back-end](https://www.techempower.com/benchmarks/#section=data-r17&hw=cl&test=json)?
  * Why use Nim for a new OS kernel?
  * Why use Nim for command-line tools?



Etc. And sometimes the answer will be "No, Nim isn't the best option". In some 
comparisons C, Python, or ye olde shell script still wins... 😉

Since I focus almost entirely on **command-line tools** , I can provide the 
following reasons for using Nim to write, let's say, [a new 
ls](https://github.com/ogham/exa), 
[rsync](https://github.com/kristapsdz/openrsync), or nmap:

  * Much more productive and safer than C/C++, with almost no performance loss.
  * No run-time, and much smaller binary sizes than Rust, D, Go, Haskell, etc.
  * Nim is more portable than some languages to obscure Unix variants (ex. all 
BSDs, Solaris, AIX, MINIX), HaikuOS, etc. Many competing languages 
([Dlang](https://forum.dlang.org/thread/hpauduyizitshugjj...@forum.dlang.org?page=3),
 Swift, .NET Core, Julia, Red/System) don't even support OpenBSD! Many also 
don't support some CPU architectures (ex. RISC-V), while Nim is easy to port 
because it can leverage just about any C compiler.
  * Having the option of using a different backend (gcc, msvc, [IBM z/OS 
XL](https://en.wikipedia.org/wiki/IBM_XL_C/C%2B%2B_Compilers), 
[icc](https://en.wikipedia.org/wiki/Intel_C%2B%2B_Compiler), 
[aocc](https://en.wikipedia.org/wiki/AMD_Optimizing_C/C%2B%2B_Compiler), 
[pgi](https://www.pgroup.com/index.htm), etc) means better performance than 
LLVM (Rust, DMD, Crystal, Swift, Zig, Pony, Kotlin Native, 
[etc](https://llvm.org/ProjectsWithLLVM/)) on some specialized platforms.
  * Nim is still a [permissive licensing champion](https://archive.fo/YShGX), 
with no restrictively-licensed dependencies and all tooling being MIT-licensed 
(or [equivalent](http://copyfree.org)). This means Nim can be used in all 
possible contexts.
  * See the "base must compile base" reasoning for [OpenBSD rejecting base 
components written in "safe" 
languages](https://duckduckgo.com/?q="Integrating+safe+languages+into+OpenBSD%3F";)
 like Rust. If any language can supplant C there, the compiler itself would 
have to have very minimal compile time. Here Nim is second [only to 
Vlang](https://archive.fo/k5XfE#selection-473.0-478.0) (which isn't a serious 
competitor yet), and orders of magnitude better than anything based on LLVM.




Re: Call to all nimble package authors

2019-09-13 Thread Libman
A few more optional field suggestions for the [dot-nimble 
format](https://github.com/nim-lang/nimble#nimble-reference):

**Author Info:**

  * `author_url` \- one or more URLs about the author (since not everybody uses 
github).
  * `author_forum` \- the author's verified handle on this forum. This can be 
the first step to adding features where authors can manage their nimble 
packages via this site.
  * `author_donate` \- info on sending the module author a cryptocurrency tip. 😃



**Fetching The Source:**

  * `dl_urls` \- Where the source code for this version can be downloaded in 
[txz](https://en.wikipedia.org/wiki/Tar_%28computing%29#Suffixes_for_compressed_files)
 format (faster and lighter than git). Can be a list of mirrors.
  * `dl_ipfs` \- the 
[IPFS](https://en.wikipedia.org/wiki/InterPlanetary_File_System) address / 
[multihash](https://github.com/multiformats/multihash) checksum of the txz 
archive. If `dl_urls` is omitted then it can be deducted from this via the IPFS 
gateways. If ipfs binary is installed, then it can be used to fetch the package 
(possibly from local cache).
  * `dl_bytes` \- expected txz archive size in bytes.



**Pre-Installation Requirements:**

  * `req_os` [(recently mentioned 
here)](https://www.reddit.com/r/nim/comments/czx51g/xors3d_game_engine_for_nim_wrapper/ezaek28/)
 \- case-insensitive comma separated list of supported 
[Distribution](https://nim-lang.org/docs/distros.html#Distribution) strings. It 
would also be useful to write like "!windows, !haiku" when you just know where 
it _doesn 't_ work. Bonus points if you can specify >= version number for 
[Windows](https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions), 
[MacOS](https://en.wikipedia.org/wiki/MacOS_version_history) 
[Android](https://en.wikipedia.org/wiki/Android_version_history), Linux kernel, 
etc.
  * `req_cpu` \- comma-sep list of supported 
[hostCPU](https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L1440) 
architectures.
  * `req_pkg` \- comma-sep list of packages that need to be installed. This can 
be normalized between distros via something like 
[pkgs.org](https://pkgs.org/download/libpq).
  * `req_bin` \- external tools that must be available and executable on the 
system for the package installation to succeed.
  * `req_compiler` \- to show this only works (or is known not to work) with 
specific backends (`gcc`, `clang`, `icc`, `pcc`, `emcc`, `node`, etc). Again, 
bonus points for >= version number.



**Other:**

  * `license` \- as [previously 
suggested](https://forum.nim-lang.org/t/4703#29372), I think the license string 
should be checked to be a valid [SPDX](https://spdx.org/licenses/) identifier, 
or a string of several identifiers joined with either `||` or `&&`.



See also: [Rust's cargo manifest 
format](https://doc.rust-lang.org/cargo/reference/manifest.html).


Re: What text editor are you using for Nim?

2019-08-02 Thread Libman
> what everyone else was using for writing Nim?

I think most people use [VScode](https://code.visualstudio.com), which has [a 
great Nim 
extension](https://marketplace.visualstudio.com/items?itemName=kosz78.nim).

The [Editor Support](https://github.com/nim-lang/Nim/wiki/Editor-Support) GH 
wiki article has details, but it needs updating. Not as cool as Mozilla's 
[AreWeIdeYet.com](https://areweideyet.com)... 🧐

> I did try Vim, and yes its faster than Emacs [...]

Vim is by no means a lean piece of software compared to [ 
Kakoune](https://forum.nim-lang.org/postActivity.xml#https-kakoune-org-kakoune) 
and [Vis](https://github.com/martanne/vis).

> but I could not get used to having to switch modes before editing text. With 
> Emacs I can just press the same keys to do certain things without having to 
> switch modes first.

Good skills take much practice...


Re: Wow. It all 'just works'

2019-08-01 Thread Libman
Related to the above:

[GitHub starts blocking developers in countries facing US trade 
sanctions](https://www.zdnet.com/article/github-starts-blocking-developers-in-countries-facing-us-trade-sanctions/)

Of course people with unpopular political opinions have been facing informal 
sanctions (ex. shadow-censorship) for years now, but a lot more people will 
soon have reasons to avoid major platforms like GitHub. It could include rather 
large nations like Russia and China... 


Re: How to Maintain a Nim Chinese Community

2019-08-01 Thread Libman
Just curious, is IPFS taking off in Mainland China?

I was thinking of thinking of possibly contemplating an IPFS mirror of the Nim 
ecosystem (git source code, Web-site snapshots, videos, binaries, etc). 


Re: How to Maintain a Nim Chinese Community

2019-07-24 Thread Libman
> I think @Araq and the team should consider hiring a Chinese speaker for 
> community management and engagement.

This shouldn't depend on the core team. People in the FLOSS communities should 
be more proactive - don't wait for "The Center" to give orders.

It would be awesome of any "special interest group" sponsored special Nim 
communities and project, be it based on spoken language, geographic location, 
focus priority (ex. web frameworks, desktop apps, etc), or anything else. 


Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-23 Thread Libman
> > Is having a "std" GUI / drawing / clipboard / etc lib really so important 
> > when there are non-"std" candidates in nimble?
> 
> Yes, quite a lot. Std GUI lib means that you can and will be able to make ui 
> using same code for every compatible platform and 90% extensions (like custom 
> controls) you will find gonna be compatible with it, not divided amidst 
> plenora of third-party libraries.
> 
> Std clipboard lib means there gonna be dependency-free clip access from any 
> supported platform, not just Windows (using my nimble package).

"Standard" means included with the standard library (stdlib), which means the 
Nim package is bigger and takes longer to compile, and updating the library 
usually has to wait for the updated Nim version. This should be reserved for 
popular and light-weight libraries.

Typing `nimble install blah` is not hard. Those libraries can be as 
multiplatform as the stdlib.

Python's "standard GUI library" is 
[Tkinter](https://en.wikipedia.org/wiki/Tkinter) (marked as "Full" in your 
image), but it's used less frequently than Python's (multiple) bindings for qt, 
gtk, wx, kivy, etc. Making this decision early on was a mistake. 


Re: Source Code Protection

2019-07-16 Thread Libman
Reverse engineering even a normal compiled binary is a lot of work, but it can 
be studied in memory. It's easy to obfuscate all identifier names and add 
computational noise (there are C/C++ products that do this), which will make 
reverse engineering harder but still doable.

The only way to entirely hide your most sensitive code is to have it run on a 
remote server that only you can access.


Re: Nim VS The World (CoffeeScript/Boo/PureBasic/C#/ES2018/Python)

2019-07-15 Thread Libman
I'm sure this is interesting for some people, but the choice of languages seems 
peculiar. I think Nim's biggest competitors are: D, Rust, Crystal, Swift, 
Kotlin Native, etc...

Is having a "std" GUI / drawing / clipboard / etc lib really so important when 
there are non-"std" candidates in nimble?

For BASIC fans: I recently did [a site popularity comparison 
table](https://voat.co/v/programming/3294907/19356549) for all living BASICs 
that I could find - maybe someone will find that useful... 


Re: Nim vs V language

2019-07-10 Thread Libman
> [It](https://github.com/vlang/v) has 1k more Github stars than 
> [Nim](https://github.com/nim-lang/Nim).

Yet another reminder that [GitHub stars are an awful harmful way to 
measure](https://old.reddit.com/r/nim/comments/8q99ba/happy_5000_stars/e0i7etu/)
 anything...

> BTW, Nim is approaching 1000 nimble modules! 🎂🎉🎆


Re: Nim vs V language

2019-07-01 Thread Libman
There goes my "V is for [Vaporware](https://en.wikipedia.org/wiki/Vaporware)" 
joke... 🙄

But on the other hand I do defend the author. Being overly ambitious and slow 
to deliver can annoy people, but there's still potential for long-term success.


Re: Nim Compilation Speed?

2019-06-28 Thread Libman
There is no such thing as "compilation speed". There are lots of different CPUs 
in existence: some specialized for mobile, some for home desktops, and some for 
multi-million-dollar super-computer compilers in the cloud.

So it's about time we start measuring compilation in terms of cost (given free 
market competition between different cloud service providers) rather than time.

(There's also overhead time to sync your source code into RAM of the compiler 
in the cloud and return the result, but on the modern Internet that's less than 
0.1 seconds.) 


Re: Nim's future: GC and the newruntime

2019-06-28 Thread Libman
> Arak

s/k/q

> If my understanding is correct, then why should I invest in Nim when I won't 
> have the advantage of the GC and instead I could use another language with 
> the same memory-management mechanism as Nim but with a huge community behind 
> it, backed by Mozilla?

  * Nim has a much better syntax (although some of this is subjective).
  * While Rust may have an optional GC mechanism (heck, so does C), for Nim 
it's been the default approach from the beginning. Even if your main project 
needs manual memory management, you'll likely have other projects you'll want 
to share code with, and most programming needs do better with GC.
  * Nim isn't married to LLVM, which can give you better performance on some 
platforms by using a different backend (gcc, 
[icc](https://en.wikipedia.org/wiki/Intel_C%2B%2B), etc). Benchmark your 
release build with different backends (including proprietary ones) to decide 
which is best. I bet this can make a bigger performance difference than memory 
management!
  * Using a fast C backend would get you faster compilation speed than Rust.
  * Not everybody loves Mozilla and the politics they are pushing. [Nim is more 
independent](https://voat.co/v/programming/2853775), politically neutral, 
legally unencumbered, and grass-roots.
  * This is 4.5 years old, but still useful: "[A Quick Comparison of Nim vs 
Rust](https://arthurtw.github.io/2015/01/12/quick-comparison-nim-vs-rust.html)".




Re: TechEmpower Web Framework Benchmarks

2019-06-04 Thread Libman
You're probably looking at their last publication, [Round 
17](https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=json) 
from Oct 30th. See the "now" link in my previous post. Rust is way ahead in 
their flagship "Fortunes" benchmark (next language is at 62%).


Re: TechEmpower Web Framework Benchmarks

2019-06-04 Thread Libman
On [TechEmpower dailies](https://tfb-status.techempower.com) Rust is 
[now](https://www.techempower.com/benchmarks/#section=test&runid=019d5c9b-823f-4890-8ed9-28c0a2718bdd)
 the absolute dominant champion in every category...


Re: Nim Advocacy & Promotion Strategies

2019-06-04 Thread Libman
> @libman please calm down and be less verbose in these quite offtopic 
> discussions. Yes, you like MIT and dislike GPL, we know, you don't have to 
> repeat it again and again...

I didn't repeat it, I brought up a new point about an exodus of Python 
programmers not happy with the growing SJW culture in that community, and how 
it could benefit Nim.

> Currently you're more harmful then helpful in protomoting Nim, I'm afraid.

I'm sorry that you feel that way...

But is that a fact? I can point to people becoming interested in Nim because of 
my advocacy and the specific copyfree / "libertarian" points that I specialize 
in. Can you point to anyone seriously saying "Nim needs more license 
restrictions"?

Do you enjoy not being able to promote code to Nim's stdlib, which by design 
logic should be included there, because it came from [a PPL-licensed 
module](https://forum.nim-lang.org/t/4703)? 


Re: Nim Advocacy & Promotion Strategies

2019-06-03 Thread Libman
> My bad trying to be sarcastic on the internet.

As I demonstrate, it is possible to be sarcastic without being wrong.

> You may have noticed that I copied the language from your illustrative 
> non-source and made some replacements:
> 
> proprietary software owners -> open-source software projects
> 
> copyright law -> patent/property laws
> 
> GPL software -> proprietary software

You are drawing a false equivalence between proprietary software and 
restrictive "free software" licenses.

Proprietary software is a non-issue to people who don't choose to use it. Nim 
is copyfree, and requires no proprietary software in order to operate. People 
choosing Nim for their proprietary projects is a long-term benefit for the Nim 
community. You bringing up proprietary software has no connection to this "Nim 
Advocacy & Promotion Strategies" topic.

Restrictive licenses, on the other hand, are [a clear and present 
danger](https://forum.nim-lang.org/t/4703) to that point of Nim advocacy. Such 
licenses enter the Nim ecosystem without most people giving them much notice. 
They do not constitute a legitimate contract (the way one can have legitimate 
point-of-sale or business contracts with Microsoft, Oracle, Apple, etc). The 
notion that some legalese attached to an `import` of an `import` of an `import` 
can bully you around is extremely dangerous. If a language like D would take 
this issue more seriously while Nim neglects it, then D would take the freedom 
crown away from Nim.

> My intention was to show that the phrase "to wrench code from the hands of" 
> is not really true and overly dramatic in BOTH cases. Nobody is forced to use 
> GPL code and then suffer consequences, just like nobody is forced to pollute 
> their open-source project e.g. with dependencies to proprietary libraries, 
> which would make it useless to many of its users.

Obviously the phrase is not literally true - source code is not a scarce 
physical object one holds in one's hands - thus the word "essentially" in the 
sarcastically-linked "[commie 
licenses](https://kazuo.io/2018/05/19/why-the-gnu-gpl-is-a-communist-ideal/)" 
article.

> I frankly don't care that much about Nims popularity, as long as it's big 
> enough to survive and improve.

Then you should politely ignore the "Nim Advocacy & Promotion Strategies" 
thread, which obviously does aim at improving Nim's popularity.

More popularity means more ability to compete with other programming languages, 
more modules, more tooling, more books, more blogs, more bug reports / fixes, 
more tutorial videos, more employment opportunities, more attractive college 
girls who need my help with their Nim homework, etc.

And also of course more sponsorship opportunities, donations, entrepreneurial 
spin-off projects, etc. I want @Araq and @dom96 to each get a private island 
and a jet for their efforts. 😁

> Being relatively small actually helps with swift sweeping moves like the new 
> runtime, and keeps the politics-level low. Nim should be the best it can 
> technologically and not rely on political/legal points. Nobody has a problem 
> with technical quality, but what you think is a big win in the 
> legal/political field could actually turn off other people.
> 
> Being relatively small actually helps with swift sweeping moves like the new 
> runtime [...]

The best way to achieve that is modularity, not obscurity. It would be great if 
Nim had modular compiler frontends (["syntax 
skins"](https://forum.nim-lang.org/t/2811)), backends, runtimes / VMs, even 
stdlibs - while sharing as much of the common infrastructure, libraries, and 
tooling as possible.

> [...] and keeps the politics-level low. [...]

That's exactly the point I am making with "lack of Ehmkeian political 
correctness witch-hunt drama is an additional bonus".

> To be honest, I find both license evangelism and CoC preaching pretty 
> annoying. Keep the politics out of it where possible.

You are making another false equivalence.

People like Richard Stallman and Coraline Ada Ehmke are the agitators who 
should have been told to "shut up and code". GitHub injecting controversial 
left-wing propaganda banners above everyone's code is another example of 
political agitation. You can't ignore the people who've started this war, and 
only blame those acting in self-defense!

My position (or that of OpenBSD, the Copyfree Initiative, etc) is political 
neutrality. You won't see me pushing licenses or CoCs attacking people I 
disagree with. I want free software to be free, with no government force 
against anyone. 


Re: I think we can really do better...

2019-05-28 Thread Libman
Saying you "can swim fast" doesn't impress people. Saying you swim X meters in 
Y seconds doesn't impress people much because most don't have an immediate 
frame of reference. Saying that you've won 
[23](https://en.wikipedia.org/wiki/List_of_multiple_Olympic_medalists) Olympic 
gold medalists - now that's a knockout blow!

What Nim needs most is to win benchmarks and other systematized programming 
language comparisons. I think [Web Framework 
benchmarks](https://forum.nim-lang.org/t/1152) are the most important point Nim 
can make about its performance. It's already doing great, but needs more 
implementations and optimization. 


Re: Nim Advocacy & Promotion Strategies

2019-05-27 Thread Libman
> From your source: [...]

It's not "source" in the journalistic sense of the word - it's an illustration. 
Like other links in that paragraph, there's some obvious whimsy; as there's 
obviously a lot of gray area between Stallman's ideals, what Stallman is able 
to get away with, and mildly restrictive licenses like [AL2 / 
PSFL](http://copyfree.org/standard/rejected) that only hamper philosophical 
purists like myself.

> And they're not even the only commies: other licenses use patent/property 
> laws to wrench code from the hands of open-source software projects who dare 
> to use proprietary software, because they state that open-source software 
> that’s bundled with proprietary software must preserve the license - 
> therefore spreading the license virally.

I don't know what you mean by " _wrench_ code from the hands of open-source 
software projects who dare to use proprietary software". Anyone can _copy_ free 
code; no one can take it away.

If proprietary copiers are able to sell their copies, despite disadvantaging it 
with their restrictions, it is only because they've added value to the people 
who voluntarily choose to pay them, improving their productivity and growing 
the economy. This added value also benefits open source ecosystems with 
improvement ideas and jobs that pay the bills for people who support free 
software in their spare time.

I myself avoid all proprietary software, and it is increasingly easy for anyone 
to do so. (Proprietary platforms like GitHub are a different story.)

> COMMUNISTS EVERYWHERE! :o)

My culture's (over)use of the word "commie" refers to a slippery slope in the 
statist direction, not a literal and deliberate identity.

My main point is that license purity can be a deliberate selling point for Nim. 
There are 100+ languages more popular than Nim, and many are catching up with 
the features, but Nim can have unique selling points they can never compete on. 
Very few languages have no uncopyfree dependencies the [way Nim 
does](https://www.freshports.org/lang/nim) (especially now that latest LLVM is 
AL2), and are portable to as many copyfree OSes (including Haiku, MINIX, etc). 
Encouraging copyfree licenses (and no [ridiculous left-wing 
threats](https://forum.nim-lang.org/t/4703)) in the module ecosystem would 
solidify Nim's claim as "the #1 most libertarian programming language". 👑

And now the lack of 
[Ehmkeian](https://theothermccain.com/2018/05/30/coraline-ada-ehmke-transgender-feminist-satanic-sjw/)
 political correctness witch-hunt drama is an additional bonus. 


Re: Nim Advocacy & Promotion Strategies

2019-05-26 Thread Libman
My predictions about [SJW derangement](http://esr.ibiblio.org/?p=6918) 
spreading and alienating a growing minority of programmers continue to come 
true:

  * [Now political correctness infects a programming 
language!](https://www.techpowerup.com/forums/threads/now-political-correctness-infects-a-programming-language.247569/)
 (older link for context)
  * [Python Language Creator: “Male Attitude” Is Hurting The Programming 
Space](https://informationbuzzer.com/2019/05/24/python-language-creator-male-attitude-is-hurting-the-programming-space/)
  * [The programmer who created Python isn't interested in mentoring white 
guys](https://voat.co/v/programming/3238105)



This again increments the "Appeal To Python Fans" point from the original post. 
But the "Appeal to License Purists" point has now grown as well. (LLVM did go 
through with their [AL2](http://copyfree.org/standard/rejected) relicensing, 
which gives Nim further license purity advantage over languages like Rust, 
Julia, Pony, LDC, Scala Native, etc.) More importantly, the license madness 
with which people like RMS started their political and cultural infiltration of 
free software has expanded to include the CoC/SWJ agitation methods like those 
mentioned above.

And so I ever-more encourage my fellow _Knights Who Code Nim_ to embrace the 
incoming political refugees escaping Python's [wicked 
trance](https://www.youtube.com/watch?v=cCX5JJwkZhU)! No 
[CoCs](https://www.reddit.com/r/MozillaInAction/comments/4pncfi/attempt_at_injecting_a_coc_in_nim/),
 no [commie 
licenses](https://kazuo.io/2018/05/19/why-the-gnu-gpl-is-a-communist-ideal/). 
Free markets, [free exchange of 
ideas](http://www.stephankinsella.com/publications/#IP), and meritocracy FTW! 🤓 


Re: [Challenge]How short or efficient can you make this code?

2019-05-21 Thread Libman
He probably works for GitHub. 😵


Re: [Challenge]How short or efficient can you make this code?

2019-05-18 Thread Libman
I didn't take time to properly understand your code or to test this, but here's 
my idea of what clean code looks like:


import os, streams, strutils

var appendCodeBlock  = ""
var filesWeAppendTo: seq[string]

let wildcard = getCurrentDir() / "*.nim"
for file in wildcard.walkFiles:
  if file.getFileSize != 427: continue
  let code = file.readFile
  if code.contains("#marker"):
appendCodeBlock &= "\n\n\n" & code
  else:
filesWeAppendTo.add file

for file in filesWeAppendTo:
  let fs = newFileStream(file, fmAppend)
  fs.write appendCodeBlock
  fs.close


Run


Re: Nim Syntax ''Skins''

2019-05-17 Thread Libman
The idea of having a binary [AST 
format](https://github.com/tc39/proposal-binary-ast) [is 
finally](https://www.phoronix.com/scan.php?page=news_item&px=BinaryAST-Proposal)
 [lifting off in the vast swamps of 
JavaScript](https://blog.cloudflare.com/binary-ast/)...

Whether this can benefit languages that compile to JS is a separate discussion, 
but it also has similarity to the Nim "Syntax Skins" idea. Break up the 
compiler into separate programs (or make it executable in partial compilation 
modes): a front-end that generates binary AST, and a backend that converts it 
to C or JS. It would then be possible to fork the front-end to create "sibling 
languages" for Nim that share the same module ecosystem and backend.


Re: Nim video lists

2019-05-14 Thread Libman
I might need to break up the "Non-English" playlist by language...

There's now [a lot of new Nim YT videos in 
Thai](https://www.youtube.com/channel/UCTyvSBAvdBPDS-7isD5GDdw/videos)! 🇹🇭👍


Re: Show: dali — a pure-Nim indie assembler for Android .dex & .apk files

2019-05-13 Thread Libman
[GNU Affero General Public License 
v3.0](https://github.com/akavel/dali/blob/master/LICENSE) 😤👎👎👎


Re: Is there way to change «proc» naming?

2019-05-07 Thread Libman
That's a typical reaction of someone coming from Python and thinking that 
`proc` has the exact same usage as `def`. In Nim there's also `func`, 
`iterator`, and `method`.

Maybe I'd recommend adding more proc-alternative keywords to make definitions 
less verbose, like...

Now: `proc uname*(a1: var Utsname): cint {.importc, header: "".}`

New: `importc sys.utsname.uname*(a1: var Utsname): cint`

But I'm not sure... 🤔 


Re: Nim vs D

2019-05-05 Thread Libman
Back on topic, [the big news in 
Dland](https://www.phoronix.com/scan.php?page=news_item&px=GCC-9.1-Compiler-Released)
 is:

"The D programming language front-end has finally been mainlined in GCC! There 
is now D support beginning with GCC 9."

I wonder if that will affect D's popularity...


Re: Nim vs D

2019-05-05 Thread Libman
> It's may be a strange question, but what do you think about PureBasic ?

I don't think about PureBasic, because it's proprietary. I don't hate 
proprietary software - I'm sure plenty of people find it useful - but I have no 
use for it personally.

It seems like PureBasic had a _raison d 'être_ around the turn of the 
millennium, when BASIC / VB was popular in universities and business, and that 
carries some momentum to the present day. It added Mac & Linux/GTK support, and 
went a different path than MS VB did with .NET, which probably made it a better 
BASIC for many business needs.

But in the current year there are better alternatives on every level. It can't 
run on other OSes (ex. FreeBSD) without emulation. Its GUI builder is no longer 
a competitive advantage given free 
[Glade](https://en.wikipedia.org/wiki/Glade_Interface_Designer) / [Qt 
Creator](https://en.wikipedia.org/wiki/Qt_Creator), which have bindings for 
many high-level languages. (Not to mention that Java and Mono are now portable 
and "free".) And the BASIC syntax is (IMHO?) much uglier than languages like 
Crystal, Swift, D, and especially Nim.




Re: "First natively compiled language with hot code-reloading at runtime"

2019-05-01 Thread Libman
> Did you read the comments at the links you list? People are saying that 
> Common LISP was doing both at the same time in the 80s.

That's why the thread title is in quotes - this is something we can discuss and 
qualify.

Maybe the exact language of the claim needs to be altered, but I'd like to see 
examples. Please note all details of the claim ― "First natively compiled 
language with hot code-reloading at runtime":

  * " **NATIVELY COMPILED** " \- as in lean machine code binaries. This 
excludes scripting languages, VMs, and huge binaries that embed the VM. I could 
be wrong (because there are a zillion Lisp descendants and implementations, 
including proprietary), but I think Lisps, Erlang, etc don't support live code 
reloading in "natively compiled" form.
  * " **LANGUAGE** " \- C/C++ hot code reloading libraries (mentioned in the 
video), which aren't well integrated into the language itself.




Re: "First natively compiled language with hot code-reloading at runtime"

2019-04-29 Thread Libman
There are many examples of VM and scripting languages that can do hot code 
reloading, including Great-Great-Great-Grandpa Lisp. And there are Lisp / 
Scheme implementations that can create native binaries. The questions is, can 
they do both at the same time?


Re: Nim @ Wikipedia

2019-04-29 Thread Libman
Yeah, that "Array Dimensions" table's First/Last columns are inconsistent 
between different languages. Some show how to get index, some value, some both. 
I just presented two things separated by ``. Also most say `0` meaning 
`name[0]`, which is confusing, but I didn't want to edit the other languages.

Please edit it however you see fit.

* * *

Next:

  * Someone more knowledgeable should update the "[Dynamic Software 
Updating](https://en.wikipedia.org/wiki/Dynamic_software_updating)" article 
[about Nim](https://www.youtube.com/watch?v=7WgCt0Wooeo).




"First natively compiled language with hot code-reloading at runtime"

2019-04-29 Thread Libman
[https://youtube.com/watch?v=7WgCt0Wooeo](https://youtube.com/watch?v=7WgCt0Wooeo)

[https://slides.com/onqtam/nim_hot_code_reloading](https://slides.com/onqtam/nim_hot_code_reloading)

[https://news.ycombinator.com/item?id=19738572](https://news.ycombinator.com/item?id=19738572)

[https://lobste.rs/s/e0skes/nim_hot_code_reloading_at_runtime_on](https://lobste.rs/s/e0skes/nim_hot_code_reloading_at_runtime_on)

[https://www.reddit.com/r/programming/comments/bgvbym/nim_first_natively_compiled_language_with_hot](https://www.reddit.com/r/programming/comments/bgvbym/nim_first_natively_compiled_language_with_hot)


Nim @ Wikipedia

2019-04-29 Thread Libman
The proposed purpose of this thread is to coordinate efforts to improve 
Nim-related articles on Wikipedia, and to add appropriate mentions of Nim in 
articles about general programming topics.

I just added Nim to the "[Comparison of programming languages 
(array)](https://en.wikipedia.org/wiki/Comparison_of_programming_languages_\(array\))"
 article, but it needs to be reviewed: reference links could be improved, and I 
didn't provide examples in the "Mathematical matrix operations" section. I hope 
someone else will improve.

When you come across a place in Wikipedia where Nim could be mentioned, but 
don't have the time / skill to add it, you can post a link on this thread.


Re: Extract a substring

2019-04-29 Thread Libman
Anyone familiar with Python (the most commonly taught introductory programming 
language, and, most importantly, 
[esr-approved](http://catb.org/~esr/faqs/hacker-howto.html)) should be used to 
to [negative 
indices](http://wordaligned.org/articles/negative-sequence-indices-in-python).

(Nim has good reason for using `^` instead of `-`, but the idea is the same.)

IMHO, avoiding it (ex `test[6 ..< test.len`) is just bad style.


Re: Nim vs D

2019-04-27 Thread Libman
> why "Projects like Nim and D can never be failures"?

I've explained that point. At very least they brought value to the thousands of 
programmers that used them, but that's just one aspect of their achievement.

D (since 2001) and Nim popularized the idea that a language can come close to 
the execution speed of C/C++ while giving programmers a ton of benefits like 
better developer productivity, a much better syntax (ex. 
[UFCS](https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax)), 
metaprogramming, modern library / module management, faster compile times, etc. 
Some of those ideas have made it back into C++ enhancement proposals, as well 
as newer languages (ex. Swift).

This is how progress often happens in the world of free software: experimental 
innovations often start in less popular projects and spread to more popular 
ones if successful. OpenBSD and FreeBSD pioneered many security innovations 
that only later made it to Linux. NetBSD was used to bootstrap the GCC 
toolchain to obscure platforms before Linux support caught up. Etc.

> what is the common between them?

  * Both compile to lean native binaries (unlike the majority of languages, 
which are either interpreted or executed on top of a VM).
  * They come [close to the speed of C](https://github.com/kostya/benchmarks) 
even with GC. And they can [replace C](https://dlang.org/spec/betterc.html) 
with manual memory management.
  * When I look through examples on Rosetta Code, I usually find that D and Nim 
are the only statically typed languages that don't make my eyes bleed. 🤮
  * They are also 100% free and [legally unencumbered](http://copyfree.org) 
(ex. unlike Java, Ada, Delphi). They're also grass-roots projects; not 
advertising campaigns for Google (Go, Dart), Microsoft (.NET, TypeScript), 
Apple (Swift), etc.
  * Both Nim and D have multiple compiler backends. With Nim you can choose any 
C compiler backend, plus there's [NLVM](https://github.com/arnetheduck/nlvm). 
With D there's dmd, ldc (LLVM), and gdc (GCC).



* * *

> what do you think about redlang

[Red/System](https://static.red-lang.org/red-system-specs.html) is interesting. 
I do like [the syntax](http://rosettacode.org/wiki/Category:Red). Cdecl FFI 
seems pretty easy.

But in many ways it's not in the same league as Nim and D:

  * **Libraries:** Red doesn't have an organized [module 
ecosystem](http://www.modulecounts.com). I couldn't find things as simple as 
PostgreSQL support. GitHub has total_count of 
[280](https://api.github.com/search/repositories?q=language:red) Red projects, 
compared to [3,115](https://api.github.com/search/repositories?q=language:nim) 
for Nim / [10,325](https://api.github.com/search/repositories?q=language:d) for 
D.
  * **Performance:** I can't find Red/System included in any benchmarks with 
Nim or D, which is quite telling. It also doesn't seem to have a [competitive 
Web framework](https://www.techempower.com/benchmarks/).
  * **Portability:** Nim one of the most portable languages imaginable (though 
I can't vouch for the stdlib), easily including every living Unix (ex. 
[F](https://www.freshports.org/lang/nim)/[O](http://openports.se/lang/nim)/[N](http://pkgsrc.se/lang/nim)/[DF](https://github.com/DragonFlyBSD/DPorts/tree/master/lang/nim)
 BSD, 
[Darwin](https://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All/nim-0.19.0.tgz),
 Solaris, AIX), 
[HaikuOS](https://github.com/haikuports/haikuports/tree/master/dev-lang/nim), 
etc. This means you can write a tool in Nim, and people will be able to `nimble 
install` it anywhere, including new / experimental / future OSes / 
microprocessors. D is behind in ports, but its [inclusion in 
GCC](https://pkgs.org/download/gdc) means very broad architecture support. Red 
only supports [12](https://github.com/red/red/blob/master/usage.txt) OS/CPU 
architecture combinations. It requires i386 binaries even on 64-bit Linux, and 
isn't included in ports for any more exotic OS.
  * **Static Binaries:** Red/System is indeed a very lean execution 
environment, but it doesn't seem to support static binaries (as far as I can 
immediately tell). A "Hello World" binary is lean, but depends on 2+ MB of i386 
.so's.




Re: Nim vs D

2019-04-25 Thread Libman
Projects like Nim and D can never be failures. They've introduced or spread 
many new ideas. Many of those ideas have already crosspolinated to other 
languages. If some ideas don't spread, they were still a worthwhile experiment.


The Philosophies Of Software Languages

2019-04-18 Thread Libman
There's a recently-concluded series of four articles collectively titled " 
**The Philosophies Of Software Languages** " :

  * Foundations, 1940 to 1972, [From Plankalkül to 
C](https://www.welcometothejungle.co/fr/articles/philosophies-software-languages)
 (includes Fortran, Cobol, Algol, Simula, BCPL/C)
  * Revolution, 1972 to 1991, [From Smalltalk to 
Perl](https://www.welcometothejungle.co/fr/articles/philosophies-programming-languages)
 (includes C++, ObjC, Haskell)
  * Evolution, 1991 to 2000, [From Java to 
JavaScript](https://www.welcometothejungle.co/fr/articles/philosophies-software-languages-javascript)
 (includes Python and Ruby)
  * Divergence, 2000 to _now_ , [From Go to 
Elixir](https://www.welcometothejungle.co/fr/articles/languages-software-go-elixir)"
 (includes Rust and Kotlin)



It's understandable that it doesn't mention Nim, because its popularity metrics 
are still far below those languages, although they are growing quickly.

Of course any such analysis is an over-simplification. There aren't distinct 
eras and many different trends happening at once. But it's still a worthy topic 
of discussion.

It's interesting to speculate how Nim can fit into that narrative if/when it 
gains popularity several years from now, and how the next major "era" of 
programming language design can be surmised.

Some ideas:

  * **Ubiquity of tooling.** Like I said [in another 
thread](https://forum.nim-lang.org/t/4770#29838), Nim makes trade-offs that 
benefit developer writing convenience over the strict consistency and 
explicitness found in languages like Ada, Java, Go, and even Python. Human 
beings write code. Computers read code. Computer time is _much_ cheaper. 
Computers can then reformat the code to be as explicit and readable as desired. 
The IDE (or a Web code view widget) can give you all the insight into the code 
that the most explicit language can give, but without cluttering you with 
obvious bureaucratic red tape when you don't want it. The ability to read code 
on dead tree pulp is no longer a priority.
  * **Ubiquity of execution.** Make an app that can run in several modes with a 
single codebase: do most of the work on the Web server, or run serverless 
inside the Web browser (ex. IPFS, WebAssembly), or in a desktop app, or a 
mobile app (ex. [nimx](https://github.com/yglukhov/nimx)), etc. Languages like 
Kotlin and Haxe can target more VMs directly, but Nim is definitely a 
contender, and smaller binary sizes than Rust could make it a better choice for 
WebAssembly.
  * **Ubiquity of DSLs**... (I might add more ideas later.)




Re: Is there a 2D game framework recently updated for Nim ?

2019-04-07 Thread Libman
Godot is probably the best 100% free game engine overall. It has 2D support 
[(now with 
"pseudo-3d")](https://godotengine.org/article/godot-32-will-get-pseudo-3d-support-2d-engine).
 There are [Nim bindings](https://github.com/pragmagic/godot-nim).


Re: similar language

2019-04-07 Thread Libman
> Because I'm looking for a cross-platform[Windows +Linux, etc], fast, 
> relatively easy language that compiles to C or C++, and which can interop or 
> imbed with code +libs from C or C++.

I'm curious to see some evidence that FreeBASIC is "fast".

(Although transpiled languages do have the advantage of choosing the best 
optimizing C/C++ compiler, which on some platforms can be gcc, clang, icc, or 
some proprietary mainframe compiler.)

I never see FreeBASIC included in any modern benchmarks, which might just mean 
it's more obscure than Nim.

> In that aspect nim is unique. Crystal comes the closest, but it only works 
> for linux.

I think Dlang comes closer to that criteria than Crystal, but that might be a 
matter of syntax preference. Dlang also has [a nice portable UI 
library](https://buggins.github.io/dlangui/screenshots.html).

But I still prefer and recommend Nim.


Re: Why Nim so inconsistent?

2019-04-07 Thread Libman
I think encouraging the use of `nimpretty` and extending its features could 
subdue a lot of criticism currently directed at Nim. It can even have options 
for consistency in things like:

  * Identifier casing / underscore style.
  * Forcing explicit module prefixes (probably the biggest issue for some 
people).
  * Function calling conventions 
([UFCS](https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax), optional 
parenthesis, named arguments, [etc](https://forum.nim-lang.org/t/4753#29720))
  * Use of `let` / `var` blocks vs repeating on multiple consecutive lines.
  * Use of comment blocks vs repeating on multiple consecutive lines.
  * Block `#end``ings (that some silly people prefer). * One ``import` line vs 
many.
  * Etc, etc, etc.




Re: Nim vs V language

2019-04-02 Thread Libman
LOL, minutes ago I happened to mention Vlang [on another thread of this 
forum](https://forum.nim-lang.org/t/1996) (before seeing this thread):

> [...] [Vlang.io](https://vlang.io). It's not even released yet (except online 
> playground), but I do like the promised features and syntax, as a refuge from 
> the growing complexity of Nim. I'd call it "Go done right", or "Go for people 
> who hate Google". 🤓

One thing that [Nim](https://irclogs.nim-lang.org/28-12-2012.html) and 
[Vlang](https://www.reddit.com/r/vlang/comments/b1oyfb/which_license_will_vlang_use/)
 have in common is that I've license-nagged both into s/GPL/MIT/. 😁 


Re: similar language

2019-04-02 Thread Libman
Is this a thread for mentioning obscure languages we're playing around with?

If so, I'd like to mention [Vlang.io](https://vlang.io). It's not even released 
yet (except online playground), but I do like the promised features and syntax, 
as a refuge from the growing complexity of Nim. I'd call it "Go done right", or 
"Go for people who hate Google". 🤓


Re: How I feel about Nim

2019-04-02 Thread Libman
> Sure, IDEs can go a long way toward helping with this problem, but if I'm 
> reading code on GitHub I often have no idea where a proc is coming from. This 
> makes it extremely difficult to trace how the code functions without cloning 
> it locally to open in VSCode.

Well, that's a trade-off, and most language designs have erred in favor of 
"paper readability". I think Nim's choice to lean in the other direction is a 
_long-term_ benefit.

For better or worse, the trend is moving to cloud-based "compiler as a 
service", which would make compile time a lot less problematic. Another trend 
is that the hippest new code editors (ex. vscode) are being based on the Web 
platform, which means they can run [inside the 
browser](https://github.com/codercom/code-server).

A [user-script](https://en.wikipedia.org/wiki/Userscript_manager) / [augmented 
browsing](https://en.wikipedia.org/wiki/List_of_augmented_browsing_software) 
script could replace code display in GitHub, GitLab, Fossil, StackOverflow, 
RosettaCode, etc with an iframe that contains not only syntax highlighting but 
tooltip hints, hyperlinks, etc. 


Re: How I feel about Nim

2019-04-02 Thread Libman
> What is it specifically about Nim that you find hard to read, compared to 
> which mainstream languages?

Nim should not be compared with "mainstream languages". Looking at the [top of 
the TIOBE Index](https://archive.fo/aISH1) \- the first 17 are either VM, 
scripting, or unsafe systems languages.

Nim should be compared with languages that: compile to native binaries, come 
close to C performance, and offer major syntax aesthetics / developer 
productivity / safety benefits compared to C/C++.

Most popular examples of that are: **Swift, D, Rust, and Crystal**.

(I've excluded Go and Haskell for considerably lower performance, executable 
size bloat, and focus on other priorities. I've also excluded older members of 
the Pascal family for much more draconian syntax. Finally, I'm not including 
new "Native" variations of languages like Kotlin, which are still flaky and 
experimental.)

(Nim can also be compared with statically typed languages that compile to JS, 
like TypeScript and Dart, but that is a separate comparison. At present most 
Nim libraries are aimed at Native. Popularization of WebAssembly will also make 
Nim's JS target less relevant.)

So the questions we should be asking is: what is it about Nim's core language 
features that makes it harder than those similar languages.

  * Why is Nim harder than Swift?



Swift is far more focused, with fewer features (esp meta-programming) and fewer 
platforms (just Apple and Linux amd64, not even BSDs).

  * Why is Nim harder than D?



IMHO: it's about on the same level.

  * Why is Nim harder than Rust?



IMHO: Nim is easier, even without GC. With some tuning you can make Nim faster 
than Rust (due to choice of backend C compilers).

  * Why is Nim harder than Crystal?



[See this thread.](https://forum.nim-lang.org/t/1246) Crystal is indeed much 
easier than Nim, while also being fast and portable... 


Re: How I feel about Nim

2019-03-30 Thread Libman
IMHO, the Nim development and code reading experience would benefit greatly 
from advanced IDE features, which as of yet don't exist. (VScode is the best 
supported editor at present.)

Nim doesn't force you to explicitly repeat the module prefix where something 
comes from - if the compiler can figure it out, so can the IDE, and make this 
info visible to you if/when you want it without making the code more verbose.

Take for example the [Xcode Swift IDE](https://youtu.be/xtZl1_zc3gg) \- it has 
a sidebar that tells you the value in each line, including explaining loops, 
graphical representations, etc. Nim would benefit from something like this, 
perhaps more than any other language. The IDE would explain exactly what's 
happening, including macros.


Re: Nim + Flutter == bright future?

2019-03-30 Thread Libman
Flutter is just Android & iPhone, right?

I'd rather see advancement of [nimX](https://github.com/yglukhov/nimx) to make 
truly portable GUIs, including OpenBSD desktop, 
[Librem5](https://puri.sm/products/librem-5/) phone, etc.


Re: nim and AngelScript

2019-03-18 Thread Libman
> How can nim generate AngelScript code?

If someone forks the Nim compiler and adds that backend. (Or pays someone else 
to do it.) Nim's core devs need to focus on much more important things.

Given that [AngelScript](https://en.wikipedia.org/wiki/AngelScript) is a very 
obscure target (compared to say JVM, CLR.NET, LuaJIT, BEAM, Go, direct 
WebAssembly, 
[etc](https://en.wikipedia.org/wiki/Comparison_of_application_virtualization_software)),
 I think the odds of that are infinitesimal. 


Re: [some offtopic] 33 = (8866128975287528)^3+(-8778405442862239)^3+(-2736111468807040)^3

2019-03-13 Thread Libman
I wanted to play around with Nim GMP for [a much simpler 
experiment](https://pastebin.com/raw/yDtNktYz): seeing how long it would take 
to find a `clong.rand` array that 
[SO3C](https://en.wikipedia.org/wiki/Sums_of_three_cubes) to <2 billion, which 
is billions of times easier than hitting a specific number. Turns out: quite a 
while... 🙄

* * *

> > but it wasn't meant to compete with hand-optimized C / Fortran / Assembly 
> > language.
> 
> Sure it was. By design C-like Nim code has no overhead.

I should have just said "hand-optimized Assembly language"... 


Re: [some offtopic] 33 = (8866128975287528)^3+(-8778405442862239)^3+(-2736111468807040)^3

2019-03-13 Thread Libman
To state the obvious... This isn't Nim related, but serious computation 
challenges typically require:

  * Looking for the most efficient search algorithm. This is for math PhDs, 
which I definitely am not.
  * The ideal algorithm would also be easy to 
[map](https://en.wikipedia.org/wiki/MapReduce) to many simultaneous processes. 
For example, Computer A might check [0,3,6..], Computer B [1,4,7..], and 
Computer C [2,5,8..]. There are sophisticated control programs for slicing out 
the jobs, since the number of available computers can change over time.
  * These computations usually involve expensive supercomputers / networks of 
thousands of computers, which is very expensive. Unless you have a major 
research grant, you probably won't be very competitive.
  * With so much hardware and electricity cost involved, math researchers are 
incentivized to spend a lot of time fine-tuning their algorithms and 
implementations. Nim is a great programming language for most tasks, and it has 
[gmp](https://en.wikipedia.org/wiki/GNU_Multiple_Precision_Arithmetic_Library) 
bindings / 
[etc](https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software),
 but it wasn't meant to compete with hand-optimized C or assembly language.




Re: Legal Threats In Nimble Packages

2019-03-09 Thread Libman
So a revised "Things I Recommend" list:

  * Checking that Nimble metadata matches the package.
  * Have `nimble init` suggest "Apache || MIT" as an option above plain 
"Apache". ("License nagging" in favor of this is becoming very common in the 
Rust community, which would totally destroy Nim's chances as "the copyfree 
language of choice"...)
  * Checking that the license string is a valid 
[SPDX](https://spdx.org/licenses/) identifier, or a string of several 
identifiers joined with either `||` or `&&`. Note that this PPL / "Peer 
Production License" isn't listed there. Invalid license string would generate a 
warning during `nimble` operations.
  * Better to give warning about licenses that are not FSF and OSI approved. I 
think that having a `nimble` warning for 
non-[CI-approved](http://copyfree.org/standard/licenses) licenses would benefit 
Nim ("Apache||MIT" being OK), but that's just my humble opinion...
  * Perhaps `nimble init` could generate a LICENSE (or 
[UNLICENSE](https://unlicense.org/)) file like `cabal init` does. Bonus points 
for a warning if it finds conflicting license file (ex. COPYING).




Re: Legal Threats In Nimble Packages

2019-03-08 Thread Libman
> Please. You haven't contributed a single library to Nim's ecosystem,

Yes, I'm a very easy target for ad hominem attacks. My interest in Nim hasn't 
moved beyond theoretical in 7 years. Guilty as charged. But does that 
invalidate all of my points?

Maybe tomorrow you'll change your license to "No Libmans Allowed". 😛

> I made 18 (including wrappers), all under Apache2.

Good, kudos, thank you. But if it was under "Apache2 || MIT" it would have been 
better for some minority of people.

> But for some reason, you keep talking as if this was a threat to the purity 
> of Nim's ecosystem.

Again, Apache isn't a top concern. This discussion thread is primarily about 
the aforementioned "no capitalists" / "no Trump supporters" licenses. (And if 
they were opposite in their political orientation I would still be concerned.) 
It's a "threat" to Nim having a competitive advantage in the [attributes of 
freedom](https://voat.co/v/programming/2853775) I've been talking about.

> Yes, two people chose to use a weird license, which is of dubious legal 
> standing and **probably** not enforceable. Big deal

That means some people cannot use those libraries, because that "probably" is a 
liability. Do you take every pill you find on the ground because it's 
"probably" not harmful?

This emergence of ever-more-restrictive licenses (which I've predicted) is 
still worth discussing. That's what this thread is for.


Re: Legal Threats In Nimble Packages

2019-03-07 Thread Libman
Please understand my priorities:

  * Dealing with the aforementioned threat of "even more restrictive than 
copyleft" licenses is the most pressing concern, and it's an issue that I hope 
most people can agree on. Nim module licenses are not the place to punish 
people you don't like.
  * The copyLEFT vs copyFREE debate is second.
  * The "not copyleft but [not quite 
copyfree](http://copyfree.org/standard/rejected)" licenses like Apache, PyPL, 
Zlib, and Vim is the lowest priority.



> why pick MIT over Apache 2? MIT doesn't have patent protection and patent 
> trolls are a real-world problem.

Apache also has additional restrictions, which is why it's [rejected by the 
Copyfree Initiative](http://copyfree.org/standard/rejected) and 
[OpenBSD](https://www.openbsd.org/policy.html). There are other ways to grant 
patent protection: like [Golang's patent grant](https://golang.org/PATENTS), 
[Rust giving you the choice of (MIT || 
Apache)](https://rust-lang-nursery.github.io/api-guidelines/necessities.html#crate-and-its-dependencies-have-a-permissive-license-c-permissive),
 or [COIL](http://coil.apotheon.org/).

(Although there's confusion in Rustland with some crates being "Apache && MIT", 
and instead of or, which is bad.) 


Legal Threats In Nimble Packages

2019-03-07 Thread Libman
Did you know that using Nim's import keyword supposedly constitutes entering 
into a contract? Are you aware of all the legalese imposed on you by the 
modules you use (as well as their dependencies, and their dependencies' 
dependencies, etc)? Here are a few examples:

  * The [libravatar](https://nimble.directory/pkg/libravatar) module uses the 
PPL / "[Peer Production 
License](https://raw.githubusercontent.com/juancarlospaco/nim-libravatar/master/LICENSE)",
 self-described as "copyFARleft". It includes language like: "Any use by a 
business that is privately owned and managed, and that seeks to generate profit 
from the labor of employees paid by salary or other wages, is not permitted 
under this license." Even professional lawyers would disagree on what that 
license actually means exactly. You might need a special permission slip signed 
by the ghost of Karl Marx...
  * The license for the [nimwc](https://nimble.directory/pkg/nimwc) module is 
incorrectly identified as "GPLv3" in nimble metadata, but it's 
[actually](https://github.com/ThomasTJdev/nim_websitecreator/blob/master/nimwc.nimble)
 the 
[PPL](https://raw.githubusercontent.com/ThomasTJdev/nim_websitecreator/master/LICENSE)
 as well. So it's not enough to look in the nimble directory, you have to look 
at the actual package code to know what "contracts" you've supposedly just 
agreed to...
  * The ["anti-fascist" 
license](https://github.com/jamiebuilds/anti-fascist-mit-license/blob/master/LICENSE)
 bans use by Trump supporters (and, judging from how many leftists misuse this 
term, anyone to the right of Bernie Sanders). This hasn't reached the Nim 
ecosystem yet (as far as I know - I didn't check every single package), but 
it's only a matter of time...



I have been observing the state of Nim ecosystem's [license 
freedom](https://copyfree.org) for quite some time. I once thought that the 
relative lack of legal encumberedness could be [a unique selling 
point](https://voat.co/v/programming/2853775) for Nim. It's been very 
disappointing to watch Nimble copyfree package percentage fall from [89.2% in 
Aug 2016](https://archive.fo/zz9t6), [88.1% in Sep 
2017](https://archive.fo/YShGX#selection-825.0-825.4), to 85.7% today. Nim's 
biggest competitor, Dlang, has been moving in the favorable direction instead...

Things I recommend:

  * Checking that the Nimble license metadata matches the license claims in the 
code.
  * Limiting the official Nimble module list to just the code with acceptable 
licenses. I think most people will disagree with me on where this line should 
be drawn, but it needs to be drawn somewhere...
  * Politely 
[nagging](https://archive.fo/7jzCs/3c8f7fb0cb40574f48e753972f0e055c61281839.png)
 module authors to encourage using the same legal terms as Nim itself: [the 
good 'ol MIT 
license](https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html),
 or [equivalent](http://copyfree.org/standard/licenses).




Re: Nim Language group in London

2019-02-25 Thread Libman
This would be a good question category for next year's [Community 
Survey](https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html):

  * In which 
[major](https://en.wikipedia.org/wiki/Globalization_and_World_Cities_Research_Network#2018_city_classification)
 world city are you most likely to attend a NimCon?
  * How likely are you to attend in 2020?
  * Which month of the year are you most likely to attend (or no preference)?



Then people at universities / technical institutes / 
[LUGs](https://en.wikipedia.org/wiki/Linux_user_group), etc in those urban 
metros would look at this data and maybe take the next step.


Re: Is nim-lang recognized world wide.?

2019-02-20 Thread Libman
  * Nim is in top 50 for [GitHub 
"star"](https://madnight.github.io/githut/#/stars/2018/4) and "issue" events.
  * Nimble (Nim's module registry) ecosystem is [among the fastest growing 
percentage-wise](https://www.reddit.com/r/nim/comments/9rf1ob/happy_800_modules_nimbles_ytd_growth_beats_d_c/).
  * Several companies are already [using Nim in 
production](https://github.com/nim-lang/Nim/wiki/Companies-using-Nim).
  * There are 550+ Nim examples [on Rosetta 
Code](https://rosettacode.org/wiki/Category:Nim), so you can see its syntax 
compares favorably to other systems languages.
  * It performs better than nearly all other languages in many benchmarks 
(search for yourself).
  * Nim is as portable as C or JavaScript, which makes it more portable than 
most other languages (including Java, .NET, and LLVM based languages). I've 
seen Nim run on a dozen obscure operating systems. It also executes well on old 
computers and microcontroller hardware.
  * You can run Nim binaries on any major cloud provider. You can also compile 
Linux cgi binaries (ex. in VirtualBox) and run them on most cheap / free shared 
hosting providers.




Re: Speeding up Python with Nim

2019-02-14 Thread Libman
I know it's not the main point of this article, but use of recursion kinda 
dulls the excitement of " ** _Speeding Up_** Python with Nim". Why not show the 
fastest fib version, with a loop?

This runs many orders of magnitude faster. It also works for n>92 (int64 
overflow). Pre-filling an initial sequence at compile time fully compensates 
for the bigint performance hit relative to int64.


import os, bigints, nimpy, times, strutils

proc fibPrefill(max: int): seq[BigInt] =
echo "Pre-calculating cache..."
result = @[1.initBigInt, 1.initBigInt]
for pos in 2 .. max:
result.add(result[pos-1] + result[pos-2])

const fibCacheStarter = fibPrefill(1000)
var fibCache = fibCacheStarter

proc fib(n: int): string {.exportpy.} =
if n < 1: return "0"
let startPos = fibCache.len
let endPos = n - 1
for pos in startPos .. endPos:
fibCache.add(fibCache[pos-1] + fibCache[pos-2])
return $fibCache[endPos]

proc fibVerbose(n: int) {.exportpy.} =
echo "Calculating for fib($1)..." % $n
let start = cpuTime()
let res = fib(n)
let elapsedNs = int((cpuTime() - start) * 1_000_000_000)
let elapsed = initDuration(nanoseconds = elapsedNs)
echo "=> $1  (in $2)\n" % [res, $elapsed]

# when isMainModule:
# if paramCount() == 0:
# fibVerbose 100
# else:
# for paramStr in commandLineParams():
# fibVerbose paramStr.parseInt


Run

Next step would be to figure out how to return Python's long number instead of 
a string...


Re: Screencast Series Ideas

2019-02-09 Thread Libman
I'd recommend a video showing off all the features of the best IDE experience 
Nim has to offer (which, last time I checked, was [Visual Studio 
Code]([https://github.com/pragmagic/vscode-nim))](https://github.com/pragmagic/vscode-nim\)\)).
 A lot of people probably tried Nim with another editor / IDE, didn't have a 
good experience, and didn't stick around.


Re: Nimrod support in Geany editor

2019-02-06 Thread Libman
I'm all for Nim support in Geany, but focusing on [the most popular 
IDEs](http://pypl.github.io/IDE.html) first would be most beneficial... Support 
in IntelliJ and Visual Studio (Proprietary, not Code) is lacking...


Re: FOSDEM "Metaprogramming in Nim" talk now online

2019-02-06 Thread Libman
>From Araq's blog — [Nim and Perl](https://nim-lang.org/araq/perlish.html) —

> Last month I tried to reimplement Perl in Nim and to see how well Nim's macro 
> system holds up for unusual domain specific language requests. **Personally I 
> do not like Perl at all** , but for a language designer it does "interesting" 
> things.

[...]

> Now what's the point in all of this? Good question. It shows a bit of my 
> philosophy as a language designer. Yes, Nim's features can be used in 
> interesting and confusing ways resulting in bad code, but **as a language 
> designer I don 't come up with arbitrary restrictions to prevent bad things** 
> since it would make the language more complex and not help much: Real bad 
> code comes from bad design, not from the desire to save a few keystrokes.

(Emphasis added.)


Re: FOSDEM 2019

2019-02-03 Thread Libman
Maybe you'll convert someone from 
[Ada](https://fosdem.org/2019/schedule/track/ada/) or 
[Rust](https://fosdem.org/2019/schedule/track/rust/) devrooms with Nim's 
superior syntax; or from the 
[Python](https://fosdem.org/2019/schedule/track/python/) devroom with superior 
scalability and efficiency. 😊

Looking forward to the videos.


Re: Compile Nim compiler to JS?

2019-01-31 Thread Libman
> Is it possible to compile the Nim compiler to Javascript?

Given enough foolishness, [all things are possible](https://www.xkcd.com/505/). 
But it would probably be _unbearably slow_. And definitely very inefficient. 
Heck, one can even run [Qemu in the 
browser](https://github.com/atrosinenko/qemujs) , so all you need is a 
sufficiently fast computer and a lean OS image with Nim installed... _What a 
bizarre and bloated future we live in!_

The Nim developer experience is best when the compiler is running on a good 
CPU, which one can rent for just a couple dollars a month per core (ex. 
[ramnode](http://ramnode.com/vps.php)). **So why not use a server?**


Re: Onsetgame ReelValley goes opensource

2019-01-30 Thread Libman
This is awesome! Thank you very much! ☺

I hope this gets as many views as possible. To promote this, I would highly 
recommend a more detailed blog post [(like this older 
one)](https://yglukhov.github.io/Making-ReelValley-Overview/) or an updated 
Web-site ([OnsetGame.com](http://onsetgame.com/) is out of date), both 
promoting the game and the development choices it involved. A video would also 
be awesome. 


Re: Nim Advocacy & Promotion Strategies

2019-01-25 Thread Libman
Latest example legal PITA from the Big Dot Com languages:

[Apple is indeed patenting Swift 
features](https://news.ycombinator.com/item?id=18997302)

> Nim is widely regarded as having too many features (which is quite unfair), 
> so I don't think more syntax sugar is gonna cut it.

I thought the Pythonic syntax tweaks I proposed we're trivial to implement and 
actually reduced complexity. If this isn't the case - nevermind.

> a "Promotion Strategy" could do more than targeting BSD core devs

Of course, that was only one niche criteria, but one where IMHO Nim happened to 
be the #1 contender.


Re: Nim Advocacy & Promotion Strategies

2019-01-21 Thread Libman
Sorry, I've made a typo / mixup in my previous post.

It originally said: "Python users are used to just saying `b = 2` for _let_ ".

I obviously meant: "Python users are used to just saying `b = 2` for _var_ ".

There is no _var_ keyword that you have to use when first create a variable. My 
"implicit var" proposal was for Nim to behave the same way for `b = 2` as for 
`var b = 2`. You'd still get _b_ type-inferred as _int_ with static checking 
like in Crystal (or like with `b := 2` in Go).

> Furthermore, even being a long time user of Python, I appreciate the use of 
> var and let in Nim. In Python, the location of the first binding of a name 
> (which we could consider to be its “declaration”) is frequently lost 
> somewhere in the code.

Nim has already embraced the 
"[F12](http://www.mynavblog.com/2018/09/12/navdevtips-15-hit-f12-some-tricks-in-vscode/)
 is your friend" mindset, but why not apply it consistently?

(F12 being the "go to definition" shortcut in vscode, Nim community's [most 
popular](https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html)
 editor. All editors in that survey support such a feature, or easily could 
with a better Nim support plugin.)

"Hey, here's a crazy idea: let's use computers to help us read and write 
computer programs!"


Re: Thoughts on imports

2019-01-19 Thread Libman
> It might look useful for simple cases

Which is what people do the majority of the time, especially when getting 
acquainted with a new language. Simple things should be simple and clean.

> but what happens when you want to import an operator? Or if you want to 
> import a hash procedure that the tables module should have access to?

Same as with `from module import nil`. This isn't always desirable, so the user 
would choose what to do when things get complicated. (Or an IDE can be told to 
automatically generate import statements for the things used.)


Re: Nim Advocacy & Promotion Strategies

2019-01-19 Thread Libman
> But when you want to make Nim very similar to Python, as Crystal did it with 
> Ruby some years ago, then traditional OOP is the largest obstacle. Some 
> syntax differences really do not matter. But most Python code uses OOP style, 
> which is not recommended by most Nim devs. So Python people would have to 
> learn this new non OOP style, and would have to redesign legacy Python code.

Excellent points.

I didn't mean that Nim should mirror Cython (or Crystal's example with Ruby) 
exactly. Note that in my original post I said: "Can the Nim community make the 
case that Nim is the best Python companion? Which future Nim development goals 
would increase this appeal?"

Nim definitely improves on Cython a great deal. I love Nim's approach of 
optional and trim OOP, including UFCS, optional parenthesis, etc. I even prefer 
Nim's style guidelines (despite coding Python since before Y2K).

But there are differences which I cannot call an improvement that **annoy 
Pythoneers for no reason** , like:

  * The redundant chanting of `let` / `var`. Python users are used to just 
saying `b = 2` for let. (If Nim did it the other way, making let default and 
var required, that would still be an improvement.)
  * Writing `from blah import nil` for every module [instead 
of](https://forum.nim-lang.org/t/3061) `use module1, module2, module3`. (This 
isn't exactly like Python, but you can get the same behavior by just using a 
different keyword.)
  * Maybe the json module could be made more approachable for people coming 
from Python and looking for an easy analogue to dictionaries.




Re: Nim Advocacy & Promotion Strategies

2019-01-19 Thread Libman
Please remember the context.

This is a "Nim Advocacy & Promotion Strategies" thread that I've started 4 
years ago. Other people are free to write their own strategy outline proposals, 
and of course these are just friendly suggestions that anyone of consequence 
can easily just ignore.

The question for this thought experiment was how to bring people in, and it 
wouldn't have been (yet) by promising the most libraries of any programming 
language, the largest certified employment pool, the smartest AI-enhanced IDE 
features, etc, etc, etc... There were already lots of programming languages out 
there (even third-tier ones like Cython, D, Rust, etc) which had many of Nim's 
virtues and orders of magnitude more users. People who'd take the initial risk 
on Nim are extraordinary people, and we should embrace that! _How do we find us 
some wonderful weirdos willing to overlook Nim 's initial shortcomings?_

I've offered several points, and I've put my "Appeal to License Purists" pet 
peeve pretty much last. I've never said it was the most important thing, just a 
point for Nim advocacy in specific niches. My reason for bumping this thread 
was also primarily about the "Appeal to Python Fans" point, commemorating how 
Python's popularity has more than doubled 
([then](https://archive.fo/roUz7#selection-219.0-222.0) vs 
[now](https://archive.fo/DVa15#selection-317.0-320.0)).

> Which niche?

I've written extensively about this in the past: people who don't like 
restrictive licenses (ex. Java), politically biased community rules (ex. Rust), 
or being a useful idiot for an advertising campaign by a major corporation that 
doesn't share their values (ex. C#, Go). There are lots of newsfeeds of people 
criticizing Google, Oracle, Microsoft, Facebook, etc. And copyfree license 
usage continues to increase - which means more projects that don't want legal 
restrictions in their build dependencies. These people mostly keep those 
feelings to themselves at present, because they are very impractical, but this 
can change.

If you'd like an example, here's one that I [recently saw on 
HN](https://news.ycombinator.com/item?id=18943413): a [clean-room 
implementation of rsync](https://github.com/kristapsdz/openrsync) that is 
unencumbered by legal threats and can be included in purist projects like 
OpenBSD. (My license-nagging of rsync's author many years ago weren't as 
fruitful as they were with Nim.) But it's sad that, in the 21st century, such 
tools still have to be written in C...

Future free software projects with libertarian principles would benefit from 
having a language to unite around, and this is something at which [Nim could 
have been #1](http://archive.fo/YShGX#selection-1243.0-1243.3), far ahead of 
languages that have thousands times more users, and that would help it achieve 
escape velocity for going mainstream.

> It's only you

It's not "only me" even on this site (ex. 
[1](https://forum.nim-lang.org/t/3473), [2](https://forum.nim-lang.org/t/2687), 
[3](https://archive.fo/hsjXr#selection-12685.0-12703.383)). But the vast 
majority of the world's developers aren't on this site - which is the point of 
this thread!

> [...] and so far your contributions consist of rumblings on this forum

This is also demonstrably false. Thousands of people have first heard about Nim 
through my various campaigns over the years.

> [...] which are more harmful than helpful for Nim's perception.

I'm sorry that you feel that way. (Hmm, perhaps apprehension of such a 
judgement is why I never contribute any code...)

I kinda feel like I'm arguing with God here: yours is the power and the glory, 
you deserve it entirely, and I am a worthless puddle of slime. Nim is your 
creation, and you can do whatever you want. I've merely offered some thoughts - 
if you don't want them, fine, I'll make myself even scarcer...

> > Recommended reading: Theo de Raadt's rejection of "safe languages".
> 
> I've read it, it's FUD.

That's not the question. The question is whether it is an "Advocacy & 
Promotion" opportunity for Nim.

Theo [said](http://archive.is/MoZi8#selection-59.1586-59.1788): "So we cannot 
replace any base utility, unless the toolchain to build it is in the base. 
Adding such a toolchain would take make build time from 40 minutes to hours. I 
don't see how that would happen."

Comparing the added compile time of the leading safe systems languages, and 
other things I've talked about in the past: Nim should win by a mile! 


Re: Nim Advocacy & Promotion Strategies

2019-01-10 Thread Libman
> Nim already has a very Python-like syntax. What is it that you suggest doing 
> differently?

There have been lots of proposals to push Nim's syntax closer to Python, at 
least for the simplest things, just [like Crystal have been very 
successful](https://forum.nim-lang.org/t/1246) by targeting Ruby. Ones that 
came from me include: implicit var, simpler type conversions, a [simple keyword 
that](https://forum.nim-lang.org/t/3061) behaves exactly like `import` does in 
Python, etc.

My past proposals can also be considered in the context of having several 
[compiler front-ends / "syntax skins"](https://forum.nim-lang.org/t/2811): Nim, 
Pythonic Nim, Curly Brace Nim, etc. This will solve 90% of criticism that Nim 
gets for not being like $SomeonesFavoriteLang.

(Hoping somebody has at least read and considered all the proposals I've posted 
here over the years...)

> IIRC you are opposed to LLVM, and from my POV LLVM backed languages (Rust, 
> Swift, Julia, C++/Clang) have risen.

This isn't accurate. I think I only brought up LLVM here in that Nim can gain 
the edge over LLVM-married languages by using the best C compiler for the job 
(which in some cases / on some platforms may be gcc, 
[pcc](https://en.wikipedia.org/wiki/Portable_C_Compiler), tcc, etc - or a 
proprietary optimizing compiler).

(I indeed am disappointed by LLVM's 
[underhanded](http://archive.fo/69wcw#selection-1521.0-1524.0) 
three-year-and-ongoing [license 
change](https://www.reddit.com/r/openbsd/comments/54xq2h/theo_de_raadt_on_llvm_license_change_proposal/)
 [drama](https://news.ycombinator.com/item?id=12617881), since my _raison d 
'être_ (at least in the programming realm) is to help create a viable 
[genuinely-free](http://www.stephankinsella.com/ip/) software stack that fits 
the license standards defined by the [Copyfree Initiative](http://copyfree.org) 
and [OpenBSD base](https://www.openbsd.org/policy.html). But this isn't a 
Nim-related issue. As long as Nim supports older versions / copyfree forks of 
Clang as well as pcc and other copyfree compilers - everything on Nim's end is 
a-OK.)

> > My points about appealing to freedom zealots like myself ("license 
> > purists", refugees from the > politics of projects like Rust, etc) have 
> > also only become more relevant.
> 
> [...] I see no evidence at all of a significant movement of "license purists" 
> who affect my industrial language/tool choices. There are multiple well known 
> licenses and company lawyers give guidance on how to deal with them. You seem 
> to be a fanatic, which is fine, but your politics aren't widely shared and 
> your views on software appear colored by your politics.

I acknowledge upfront that I'm biased on this issue, and that "license purists" 
/ CoC culture rejects / etc are a minority. But Nim's total market share is far 
smaller, probably like 0.01% or 0.001%. The number of people who like the 
freedom points I'm making is several orders of magnitude greater. There aren't 
many things Nim can be Number One Best at, but it is on this issue. So **this 
is a valid niche for Nim to embrace**!

As I posted [in detail](http://archive.fo/YShGX) previously, Nim ranks #1 in 
percentage of the nimble ecosystem having a copyfree license, in addition to 
all-copyfree tooling, lack of an evil corporate sugar-daddy, lack of a [SJW 
witch-hunt culture](http://esr.ibiblio.org/?p=6918), and perfect portability to 
all copyfree OSes (BSDs, Haiku, MINIX, etc).

Recommended reading: [Theo de Raadt's rejection of "safe 
languages"](https://www.reddit.com/r/rust/comments/7hgstc/theo_de_raadt_on_integrating_safe_languages_like/).
 I think Nim should position itself (technically, legally, and culturally) as 
the #1 most likely candidate for a project like OpenBSD (and those with similar 
philosophy) to embrace. 


Re: "Nim needs better documentation" - share your thoughts

2019-01-10 Thread Libman
We don't _need to_ , but there's plenty of material.

That's what [v/](https://voat.co/v/programmerhumor) r/ProgrammerHumor is for. 😇


Re: "Nim needs better documentation" - share your thoughts

2019-01-08 Thread Libman
> @Libman 's proposal is extravagant but appealing.

My [proposal](https://forum.nim-lang.org/t/4523#28308) consists of multiple 
small points: some are easy for one person to start, while others are more of a 
long-term vision.

The basic idea is to use a wiki to provide additional "documentation space" for 
everything: modules, tools, compiler messages, topics, patterns, etc.

> Easy, just invite more Arch Linux users to Nim. ;P
> 
> (phun intended, Arch wiki is known for some of the best Docs)

This "Wiki culture" is a very good thing, I wish more projects had it...


Re: GSoC 2019

2019-01-04 Thread Libman
Have you ever wondered why Google (a for-profit mega-corp that makes money by 
manipulating people, and was pretty much a member of the government during the 
prior US administration) is giving things away for "free"?


  1   2   3   >