Recent posts

#11
newLISP newS / Re: Forked newLISP – Meet Rebe...
Last post by itistoday - November 15, 2025, 01:15:16 PM
Woah this is awesome! Congrats Ufko! I'm excited to see where this goes, please keep us posted of updates!
#12
newLISP newS / Forked newLISP – Meet Rebel
Last post by ufko - November 15, 2025, 04:43:59 AM
Hi guys,

I've forked newLISP 10.7.6 and made a few targeted changes:

    Removed compiler warnings
    Fixed or double-checked known bugs from the forum
    Refactored some internal structures for clarity
    Renamed files to match the new project name Rebel
    On BSD platforms, rebel-math.c now uses arc4random() for random numbers

Reasons for the fork, refactor, and renaming:

    Clear project identity 
    Wider adoption if it's not called newLISP 
    Less hate and flamewars 
    End of endless comparisons with LISP 
    Lutz had revolutionary thinking and was a rebel in his own way 
    Independence of development and ability to make internal changes 
    Better communication with new users 
    Motivation for contributors 
    Clear distinction for documentation, tutorials, and community

Just like most users, for example, don't perceive Clojure as a "new Lisp" but as a language with Lisp-like syntax that integrates smoothly into the JVM world, Rebel can be perceived similarly, as a Lisp-like tool that integrates smoothly with the C world.

It now runs cleanly on OpenBSD 7.8, 64-bit, UTF-8, with libffi support.

⚡gringo ~/me/c/rebel/src $: make
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-symbol.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-math.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-list.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-liststr.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-string.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-filesys.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-sock.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-import.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-xml-json.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-web.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-matrix.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-debug.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI rebel-utf8.c
cc -m64 -Wall -fno-strict-aliasing -O2 -c -g  -I/usr/local/include -DREADLINE -DREBEL64 -DSUPPORT_UTF8 -D_BSD -DFFI pcre.c
cc rebel.o  rebel-symbol.o  rebel-math.o  rebel-list.o  rebel-liststr.o  rebel-string.o  rebel-filesys.o  rebel-sock.o  rebel-import.o  rebel-xml-json.o  rebel-web.o  rebel-matrix.o  rebel-debl
ld: warning: rebel-web.c:1389(rebel-web.o:(handleHTTPcgi)): warning: random() may return deterministic values, is that what you want?
strip rebel

⚡gringo ~ $: rebel -n
rebeL v.0.1 64-bit on BSD IPv4/6 UTF-8 libffi, options: rebel -h

>

Functionality remains fully compatible with newLISP.

If you edit your Makefile contents, it should compile without problems.

I've bought the domain
https://rebel-lang.org

I've created an empty GitHub organization at
github.com/rebellang

For now, the repository is hosted under my account:
https://github.com/ufko-org/rebel

I fully respect GPL3 and Lutz's copyright.
Everyone is welcome to test the code.
Everyone is welcome to provide feedback, and share suggestions here in the forum for now.

And so I don't forget: scripts have the .rbl extension... Surprisingly 😄

Cheers, Ufko
#13
newLISP in the real world / Re: regex-all
Last post by cameyo - June 15, 2025, 08:52:37 AM
Thanks.
You reminder me of 'collect' ... :)
#14
newLISP newS / Re: Wisp to new lisp
Last post by rrq - June 13, 2025, 09:11:43 PM
Yes I like parentheses too 8) . I remember Interlisp having square brackets as "meta parentheses" so as to avoid strings of stopping parentheses; the two forms interoperated so that ']' closed all '(' to match prior balancing '[', and likewise ')' closed all '[' to match prior balancing '('.
One could then write for example the following
(define (factorial n)
    [if (zero? n)
        1
        (* n (factorial (- n 1 ] )
Perhaps it's clearer? But the reader has to know the syntax in any case.
#15
newLISP in the real world / Re: regex-all
Last post by rrq - June 13, 2025, 06:53:48 PM
I suppose one might use find-all for that. Though, find-all doesn't provide the character index, and it doesn't provide the match overlap variant. It wouldn't be terribly hard to patch the source to make find-all offer the index (eg as $index) similar to the match count.

However, one can use collect and a small helper function to get the following alternative solution:
> (define (regex-all EXP STR OPT ALL)
  (let ((i 0)
     (move-i (fn (X) (setq i (+ (X 1) (if ALL 1 (X -1)))) X)))
      (collect (if (regex EXP STR OPT i) (move-i $it)))))

> (setq a "AAAaBAAAABcADccAAAB")
> (regex-all "[A]{3}" a 0)
(("AAA" 0 3) ("AAA" 5 3) ("AAA" 15 3))
> (regex-all "[A]{3}" a 0 true)
(("AAA" 0 3) ("AAA" 5 3) ("AAA" 6 3) ("AAA" 15 3))

EDIT: I fixed to use EXP rather than hard-coded search pattern.
#16
newLISP newS / Re: Wisp to new lisp
Last post by itistoday - June 13, 2025, 04:44:12 PM
Yeah same here, parenthesis make everything easy to understand for me, I honestly don't get why anyone hates them.
#17
newLISP in the real world / regex-all
Last post by cameyo - June 13, 2025, 07:49:32 AM
Does anyone know of any more efficient methods than the following to calculate all the matches of a regex?
Thanks.
(define (regex-all regexp str all)
"Find all occurrences of a regex in a string"
  (let ( (out '()) (idx 0) (res nil) )
    (setq res (regex regexp str 64 idx))
    (while res
      (push res out -1)
      (if all
          (setq idx (+ (res 1) 1))        ; contiguos pattern (overlap)
          (setq idx (+ (res 1) (res 2)))) ; no contiguos pattern
      (setq res (regex regexp str 64 idx)))
    out))

(setq a "AAAaBAAAABcADccAAAB")
(regex "[A]{3}" a)
;-> ("AAA" 0 3)
(regex-all "[A]{3}" a)
;-> (("AAA" 0 3) ("AAA" 5 3) ("AAA" 15 3))
(regex-all "[A]{3}" a true)
;-> (("AAA" 0 3) ("AAA" 5 3) ("AAA" 6 3) ("AAA" 15 3))
#18
newLISP newS / Re: Wisp to new lisp
Last post by cameyo - June 07, 2025, 10:36:27 AM
Interesting, but I'm fond of parentheses. :)
#19
So, what can you actually DO with newLISP? / Re: newLISP Code
Last post by itistoday - May 18, 2025, 01:20:01 PM
Nice!
#20
So, what can you actually DO with newLISP? / newLISP Code
Last post by cameyo - May 18, 2025, 10:23:30 AM
Problem Solving with newLISP
https://github.com/cameyo42/newLISP-Code
More than 3000 topics on newLISP:
- Algorithms
- Project Euler
- Rosetta Code
- Programming interview questions
- Library for recreational mathematics (344 functions)
- a lot of programming problems