Re: Nim tutorial -- Kaushal Modi's notes

2019-12-05 Thread edu500ac
Hi, carterza. Vernon's intention was to close the page. Then Kaushal Modi asked us to bring it back, and offered the notes as his contribution. Even so, I wrote him an email asking whether the Della-Vos group could use his notes. You can check his answer at the github repository, under the tab

Nim tutorial -- Kaushal Modi's notes

2019-12-03 Thread edu500ac
This is to bring you up to date with the Nim tutorial that the Della-Vos group is writing. Vernon started working on Kaushal Modi's notes. These notes are very instructive and cover very basic material, which could be quite helpful for beginners. Therefore, we decided to place Kaushal Modi's

Re: The authors of the Nimacros project stopped working on that book

2019-11-26 Thread edu500ac
Hi, Stefan. Vernon Sipple work in this project only on Tuesdays, so he is not around to answer your questions, but I can provide a temporary answer. By the way, my name is Philip, or Philippos, in Greek. The person who is writing the book is Vernon Sipple. First question: "How many Nim experts

Re: The authors of the Nimacros project stopped working on that book

2019-11-26 Thread edu500ac
the posting of a chapter and my proof reading. During this interval, you will see things such as authors writing _bear_ for _beer_ and programs with awful bugs. I am posting this answer under the pseudonym of edu500ac, since I could not remember the password for the email that I created for accessing

Re: The authors of the Nimacros project stopped working on that book

2019-11-23 Thread edu500ac
Hi, mikra. Let me tell why the past work was deleted. There are only three persons who write well in the Della-Vos Group, none of them are programmers. For instance, Dr. Vernon Sipple, the main writer, is a garden designer, not a programmer. Philippos Costa, the other writer, has a minor in

Help needed: Nested lists in Nim

2019-11-19 Thread edu500ac
I decided to write a simple tokenizer as the starting point for recursive descent parsers. Therefore, I needed nested linked lists of the sort that I can find in Lisp, Prolog and other languages. After searching the web, I came across a discussion from 2015 between _andrea_ , _def_ and _Jehan_

A simple web page with utf-8 html form

2019-11-17 Thread edu500ac
I wrote a very simple web application just to learn how to do the job. Basically, the web page present a few lines of the Iliad, and has a visitor book. In the previous version, the visitor book worked with ASCII characters only. However, I noticed that many people wanted to test the page with

Re: Web applications and pattern match

2019-11-17 Thread edu500ac
Hi, Vindaar. I will use the solution you pointed out in the tutorial. By the way, if you visit the demo page, you will see that I already replaced the inicial version of the program with another one, which is based on the scanf. I also used the decode.Url procedure in order to test the utf-8

Re: Problems with Emacs mode for Nim

2019-11-17 Thread edu500ac
As far as I know, Vindaar, it is possible to program Emacs in any language through the Emacs Dynamic Mode. I believe that even in Nim. It is also possible to write extensions in neovim for any language, although the feature works better in the case of dynamic languages, such as Common Lisp,

Problems with Emacs mode for Nim

2019-11-16 Thread edu500ac
Students who are trying to learn Nim complain that Emacs modes for Nim do not work flawlessly, and are huge. These students tried nimrod-mode and nim-mode. Here are a small sample of the problems that they encountered: 1 -- nimrod-mode does not highlight multiline comments. 2 -- nim-mode often

Re: Problems with Emacs mode for Nim

2019-11-16 Thread edu500ac
By the way, I posted these comments about nimrod-mode and nim-mode because one often asks why Marcus and Luciano are using lem with their students.

Re: Nimdoc: example of nimscript

2019-11-16 Thread edu500ac
As for using lem instead of emacs, the problem is that we could not find an emacs mode that works flawlessly for nim. The students tried nimrod-mode and nim-mode: 1 -- nimrod-mode does not highlight multiline comments. 2 -- nim-mode often fail in performing indentation. For instance, in the

Re: Nimdoc: example of nimscript

2019-11-16 Thread edu500ac
Hi, Kaushalmodi. I saw your answer only now. I will study the link you sent me carefully. Thank you for the attention.

Re: Cross compiling for Linux

2019-11-15 Thread edu500ac
Hi, Stefan. Thank you for providing me the links, which indeed solved the problem. Below, I will describe the solution, in case someone else comes across the same problem. 1 -- I wanted to compile dynamic Internet pages running on a Linux server. My machine is a Macintosh mini box. I used

Cross compiling for Linux

2019-11-15 Thread edu500ac
I work with Macintosh mini box, but I use Linux in the cloud. Therefore, I installed musl-cross gcc, and tested it with a small programa in C: #include #include int fib(int i) { if (i<2) return i+1; if (i<3) return fib(i-1)+fib(i-2); return fib(i-3)

Nimdoc: example of nimscript

2019-11-14 Thread edu500ac
The nim tutorial that the Della-Vos group is slowly writing is here: [https://github.com/FemtoEmacs/nimacros](https://github.com/FemtoEmacs/nimacros) The main novelties are: 1 -- Example of nimscript, suggested by RSDuck and coded by SolitudeSF 2 -- Translation of Fibonacci's Cuniculorum

Help needed on script for compiling Nim programs

2019-11-14 Thread edu500ac
I am using a Makefile script for compiling Nim programs. However, RSDuck suggested the replacement of Makefile with nimscript. I confess that I didn't know anything about the very existence of nimscript, and I want to thank RSDuck for drawing my attention to it. However, in nimscript, I

Re: Collective book about Nim: Fibonacci's algorithm fixed

2019-11-14 Thread edu500ac
Great. In fact, I already found your macros in another thread of this forum. Very interesting work, by the way.

Re: Domain modeling in Nim

2019-11-10 Thread edu500ac
eterps, the links you provided are great and certainly will answer the question about domain-modelling. I will pass them to the Canadian student.

Re: Domain modeling in Nim

2019-11-10 Thread edu500ac
Hi, mikra, I know the Thinking Forth book, by Leo Brodie. I agree with you, it is very good indeed. However, young people want to follow the trend, things that don't work, as mratsin hinted. I guess you know the following article:

Re: Domain modeling in Nim

2019-11-10 Thread edu500ac
Hi, mratsin. I am not talking about writing a MUMPS interpreter in Nim. Every physician has access to the official MUMPS. In fact, every physician in the United States starts his/her medical residency with MUMPS and CCL. Besides, the physician needs to take a high stakes test, USMLE step 2

Domain modeling in Nim

2019-11-09 Thread edu500ac
A couple of weeks ago, I suggested the use of Nim in parallel with other languages for teaching Software Engineering and Data Structures. I decided to write a book about macros in Nim to help the students. However, in response to requests from students, I asked their teachers to add

Re: I'd like to offer some suggestions re: Nim documentation. Github? This forum?

2019-11-06 Thread edu500ac
I run on the same problems you listed in your intervention. What I did was to create a group for writing a book on Nim. Here is our github page: [https://github.com/FemtoEmacs/nimacros](https://github.com/FemtoEmacs/nimacros) If you want to collaborate with proofreading or even writing a

Fixed nim-mode for lem

2019-11-03 Thread edu500ac
I fixed nim-mode for lem. The main problem was in the syntax coloring for multi-line comment blocks. I also introduced missing items in the keyword list and in the type list. By the way, I did not fix spelling or grammar mistakes from the original authors. Therefore, words like _sepalador_ and

Re: Make Nim easier for the developer

2019-10-27 Thread edu500ac
Hi, AMoura, thats me again. I think that the main problem with computer languages is not lack of features. My major concern about computer languages is that most of them do not keep backward compatibility. I liked the _Yi_ text editor, which happened to be written in Haskell. Do you know why I

Re: Make Nim easier for the developer

2019-10-27 Thread edu500ac
Hi, AMoura. I don't care about language popularity, university ranking and the like, specially the kind of popularity that one measures with tools, such as TIOBE index and Webometrics. Let me tell you why. Let us consider university ranking. There is a very low ranked university in Russia,

Nim compiler produces misplaced warnings

2019-10-27 Thread edu500ac
I tried to program a Lisp-like sexpr for writing macros, as suggested by mratsim (Mamy Ratsimbazafy). Since I used symbol for tagging symbols, as in Ratsimbazafy's DSL, the compiler issued a warning that symbol is deprecated. It seems that the Nim compiler confused my use of the symbol

Re: Requesting examples of macros in Nim

2019-10-27 Thread edu500ac
Hi, martsim. I tried to develop a Lisp like consp data structures for writing macros. I used your Domain Specific Language as a starting point. The experiment is far from a success, but I decided to share the results with you, maybe you can help me. Here is what I got: import os,

Re: Requesting examples of macros in Nim

2019-10-26 Thread edu500ac
Hi, mratsin. Thank you for the link to your work. By studying your first example, I was able to create a Lisp like AST, however I could not discover a way to convert it to a Nim AST. Could you take a look at my program, and suggest a way of converting it into a functional Nim macro? By the

Re: Della-Vos tutorial on Nim macros

2019-10-26 Thread edu500ac
Thank you for the correction.

Re: Requesting examples of macros in Nim

2019-10-25 Thread edu500ac
Hi, akavel. Just to let you know that I read your interesting and quite complete exposition on macros to the book our group is writing. By the way, I always considered match a necessity of modern discipline of programming.

Re: Della-Vos tutorial on Nim macros

2019-10-25 Thread edu500ac
I received requests for publishing the documentation for Nim macros both in 'Read the Docs' and in the same media that Vsevolod Domkin to publish his _Programming Algorithms_ book. I confess that I never had heard about Vsevolod Domkin until yesterday, when I started receiving emails talking

Della-Vos tutorial on Nim macros

2019-10-24 Thread edu500ac
The Della-Vos group published the first draft of a book on Nim macros. [https://github.com/FemtoEmacs/nimacros](https://github.com/FemtoEmacs/nimacros) The material was written in two days, therefore it certainly contains spelling mistakes, grammar errors and gaps in the contents. You will find

Re: Requesting examples of macros in Nim

2019-10-22 Thread edu500ac
Hi, kcvinu. I agree with your post in every point. Therefore, I am writing two books, one on macros, and the other on why computer languages become obsolete, and how this phenomenon impacts on long range projects, like Cyc, ACL2, Emacs and Maxima: [https://www.cyc.com](https://www.cyc.com)/

Re: Requesting examples of macros in Nim

2019-10-22 Thread edu500ac
Hi, Vindaar. I am retired right now. However, one of my PhD students, Marcus Tolentino, is a professor at Ryerson University, Toronto, Canada. He is teaching Data Structures to 260 students. I myself worked at Utah State University, Logan, Utah (but I am not Mormon nor believe that God lives in

Re: Requesting examples of macros in Nim

2019-10-22 Thread edu500ac
Hi, Juan Carlos. Your example was of great help, indeed. I wrote a small macro based on it. Please, take a look and let me know where it can be improved: import macros macro iter(i:untyped, c1:untyped, c2:untyped, stm:untyped): untyped = result =

Requesting examples of macros in Nim

2019-10-22 Thread edu500ac
# Nim macros I confess that Nim macros defeated me. My expectations were that I would learn Nim macros as easily as I had learned Lisp macros, but no, Nim macros are tough. Then I started to create theories about my difficulty in learning Nim macros. ## Theory 1: Lisp chauvinism Nim macros are

Re: split does not seem to work properly

2019-10-15 Thread edu500ac
Dear miran. I tried your suggestion, and I keep having problems. As you can guess, my idea is to parse a comma separated value file, or _csv file_ for short. In practice, csv files are not separated only by commas. You will find people that combine commas with spaces, or use only spaces. On

split does not seem to work properly

2019-10-14 Thread edu500ac
The following program is supposed to calculate the average of a list of numbers: # File: awg.nim import os, strutils, sequtils, sugar proc main() = if paramCount() < 1: quit("Usage: x-sexpr.x 1000") let s = readFile(paramStr(1)).split(Whitespace) xs= s.map(x => parseFloat x) echo