Search found 39 matches

by Astrobe
Wed Jan 30, 2019 5:52 pm
Forum: newLISP newS
Topic: Ask info about newLISP
Replies: 6
Views: 2385

Re: Ask info about newLISP

One thing on the TODO list: non-blocking sockets, which would allow internet services to be more reliable and avoid a race condition when doing things the traditional way using net-select/accept on sockets that are bound and listening for incoming connections. Haven't had time to do it myself. One ...
by Astrobe
Wed Sep 13, 2017 9:26 am
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 4648

Re: Newlisp vs Lua

Actually to me co-routines are not a major feature in Lua. One problem is that a procedure which is not "co-routine aware" cannot be turned in to a "co-routine aware" one. If someone provides a GUI library without a single-step gui.run() function (silly example), you are screwed. So if you have a lo...
by Astrobe
Tue Sep 12, 2017 7:41 am
Forum: Anything else we might add?
Topic: Newlisp vs Lua
Replies: 11
Views: 4648

Newlisp vs Lua

Let's Rock'n'Troll! I've lurked on comp.lang.forth for a long time. One thing I couldn't understand is why people constantly compared Forth with C, which was pointless in my eyes because they where in whole different categories. It became even more pointless when Lua began to gain traction, because ...
by Astrobe
Sun Mar 19, 2017 1:52 pm
Forum: Anything else we might add?
Topic: FOOP destructors?
Replies: 4
Views: 6269

Re: FOOP destructors?

FOOP. The F should be a P. Every time I try to use it for something more object-y than glorified structures, it falls flat on its face (and even as glorified structures, it's not really convenient out-of-the-box). I'd rather use contexts for prototype-based objects. Kind of what the /dev/urandom exa...
by Astrobe
Tue Dec 30, 2014 10:59 am
Forum: Anything else we might add?
Topic: NewLISP GUI using web elements
Replies: 2
Views: 4783

Re: NewLISP GUI using web elements

I quite agree that Java is becoming less relevant these days. But I disagree that the way to go is the browser. Just like Java, Javascript is cool because it's "already there" and "cross-platform", but it's still poor at making interactive apps. The CSS/HTML/Javascript was never meant to build deskt...
by Astrobe
Tue Sep 30, 2014 4:29 pm
Forum: newLISP in the real world
Topic: write-file should add parameter to specified character
Replies: 4
Views: 1612

Re: write-file should add parameter to specified character

Maybe the OP was talking about the name of the files rather than the content?
by Astrobe
Wed Sep 24, 2014 8:02 am
Forum: newLISP in the real world
Topic: IUP bindings
Replies: 1
Views: 1182

IUP bindings

Hello,

Doe anyone have bindings for the IUP library?
by Astrobe
Sun Jun 29, 2014 12:57 pm
Forum: Anything else we might add?
Topic: Serial Port Module?
Replies: 6
Views: 5715

Re: Serial Port Module?

To me, the major split is between Windows and Linux platforms. That's also true for sockets. You have no choice but to write platform specific code and to hide the differences behind the a common API. As for DSR/DTR, RS is such a mess that one can always stumble upon some hardware that do use that. ...
by Astrobe
Thu Jun 26, 2014 10:19 pm
Forum: Anything else we might add?
Topic: flat enough?
Replies: 4
Views: 3867

Re: flat enough?

That's because '(1 2) is a quoted expression, not a list:

Code: Select all

(list? (nth 0 '('(1 2) (3 4)))) ; --> nil (id est, false)

Code: Select all

(quote? (nth 0 '('(1 2) (3 4)))) ; --> true
by Astrobe
Mon Jun 02, 2014 12:05 pm
Forum: newLISP in the real world
Topic: I/O multiplexing on pipes
Replies: 7
Views: 2476

Re: I/O multiplexing on pipes

int returnneg(void) is a valid prototype.It's actually "more correct" than int returnneg(): the former tells that the function takes no arguments, while the latter can take any number of arguments.

source: http://www.drdobbs.com/c-and-c-case-stu ... /184401562
by Astrobe
Sat May 24, 2014 12:07 pm
Forum: newLISP in the real world
Topic: a journey in seek of a new language
Replies: 2
Views: 981

Re: a journey in seek of a new language

I work with the manual essentially, plus the "code patterns" file. Both of them give a lot of recipes. One thing to note about NewLisp is that its built-in functions library is very rich. And many of these functions can be used in more than one way thanks to the clever use of default parameters. As ...
by Astrobe
Mon Mar 24, 2014 6:40 pm
Forum: Whither newLISP?
Topic: RFC: A reference counted newLISP (and how to implement it).
Replies: 6
Views: 7992

Re: RFC: A reference counted newLISP (and how to implement i

Maybe that work could be reused for a different thing. I didn't really run into the issue as of yet, but a potential memory management problem may happen with external libraries that return allocated object, and you are responsible for freeing them. It seems there exist no way to "link" with Newlisp...
by Astrobe
Fri Mar 21, 2014 12:25 pm
Forum: newLISP in the real world
Topic: if we can see line number in error message
Replies: 11
Views: 1901

Re: if we can see line number in error message

Debugging and error messages are still a weak point of Newlisp for me. I could make it slightly easier by inserting a call to getDebuggerInput() at the end of printErrorMessage(). At least one can check the value of local variables, arguments, and even those of the callers if names don't overlap. Ca...
by Astrobe
Fri Mar 21, 2014 9:22 am
Forum: newLISP in the real world
Topic: Optimisations
Replies: 2
Views: 919

Optimisations

Arrays versus Lists The deal is that lists are good at insertion and bad at random access, while arrays suck at insertion and are good at random access (I've measured a 30% difference on random accesses). More often than not, one does a bit of both, so the choice between lists and arrays is not obv...
by Astrobe
Tue Mar 18, 2014 11:15 am
Forum: So, what can you actually DO with newLISP?
Topic: newLisp vs node.js
Replies: 5
Views: 4784

Re: newLisp vs node.js

Node.js is popular because it's javascript. It let "web" developers reuse their knowledge, server-side. Javascript itself is one of the biggest steal in CS history IMHO. The language design is full of WTFs (kind of the opposite image of Newlisp if you ask me), but it is the language of web browsers....
by Astrobe
Tue Mar 18, 2014 10:43 am
Forum: newLISP in the real world
Topic: portability issue with net-receive-from
Replies: 1
Views: 798

portability issue with net-receive-from

I used (net-receive-from) to make a little UDP proxy under linux. When I ran it under windows, it unexpectedly didn't work.

It seems that under Windows (XP), the address field which is returned is in the form ip-address:port.
by Astrobe
Tue Mar 18, 2014 10:17 am
Forum: newLISP in the real world
Topic: FOOP recursive method
Replies: 4
Views: 1014

Re: FOOP recursive method

Maybe a useful tip: use letex to avoid fiddling manually with self-fields. For instance:

Code: Select all

(letex (H '(self 1) L '(self 2))
   (define (rectangle:perimeter) (* 2 (+ H L)))
   (define (rectangle:area) (* H L)))
by Astrobe
Wed Mar 05, 2014 5:26 pm
Forum: Whither newLISP?
Topic: fexpr issues
Replies: 18
Views: 7207

Re: fexpr issues

I know this is different from what I initially asked for, but... if you remove lines from 4912 to 4921 (the ones that insert the expansion code), one gets interesting options for forging the replacement expression. Like for instance this improved curry: (macro (curry*) (case (length $args) (2 (letex...
by Astrobe
Wed Mar 05, 2014 11:54 am
Forum: Whither newLISP?
Topic: fexpr issues
Replies: 18
Views: 7207

Re: fexpr issues

Also, I spotted by chance a misuse of define-macro in the "apply" entry: my-gcd is defined as a macro; but if you try (my-gcd 12 18 (+ 1 2 3)) one gets an error.
by Astrobe
Tue Mar 04, 2014 5:40 pm
Forum: Whither newLISP?
Topic: fexpr issues
Replies: 18
Views: 7207

Re: fexpr issues

Oh, nice!

Do I have to wait 10.5.8 to officially come out or can I grab it right now?
by Astrobe
Tue Mar 04, 2014 8:42 am
Forum: newLISP in the real world
Topic: read-line optimisation
Replies: 3
Views: 1040

read-line optimisation

Hello, While programming a little tool that analyses some log file, I've noticed that read-line is a bit slower than one would expect. Looking at its code, it appeared to me reading the stream char-by-char could be the cause. I Modified it to use fgets instead: char * readStreamLine(STREAM * stream,...
by Astrobe
Fri Feb 28, 2014 7:07 pm
Forum: Whither newLISP?
Topic: fexpr issues
Replies: 18
Views: 7207

Re: fexpr issues

May be if you replace (println k) with (println “=====>” k), you can better follow the debug behavior Indeed I thought about this possibilty and did something like that. It seems I didn't put enough dashes in my println. fexprs are functions, so I would argue: the behavior is expected. args should ...
by Astrobe
Fri Feb 28, 2014 9:42 am
Forum: Whither newLISP?
Topic: fexpr issues
Replies: 18
Views: 7207

fexpr issues

Consider this dumbed-down version of do-until: (module "macro.lsp") (define-macro (DO-UNTIL test B) (do-while (not (eval test)) (eval B))) (macro (DO-UNTIL* T B) (do-while (not T) B)) (println "test 1") (define (foo k) (DO-UNTIL (<= k 0) (begin (println k) (dec k)))) (foo 3) (println "test 2") (defi...
by Astrobe
Wed Jan 29, 2014 11:28 am
Forum: newLISP in the real world
Topic: FFI - struct passed by value
Replies: 2
Views: 849

Re: FFI - struct passed by value

Thanks. (set 'GA "gappw32.dll") (struct 'Rect "int" "int" "int" "int") (import GA "app_new_app" "void*" "int" "void*") (import GA "app_new_window" "void*" "void*" "Rect" "char*" "long") (import GA "app_main_loop" "void" "void*") (import GA "app_show_window" "void" "void*") (import GA "app_new_label"...
by Astrobe
Tue Jan 28, 2014 10:46 pm
Forum: newLISP in the real world
Topic: FFI - struct passed by value
Replies: 2
Views: 849

FFI - struct passed by value

I'd like to use this nice little GUI library: http://enchantia.com/software/graphapp/ The widget set is not as full featured as other libraries but it's good enough for simple user interfaces. Plus it fits in a single 700K DLL and is portable. The problem is that it passes and returns one of its maj...