Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - statik

#31
newLISP newS /
August 15, 2005, 12:55:25 PM
Brian pwns. eof.
#32
newLISP newS /
August 15, 2005, 12:53:12 PM
I suppose anything written for kozoru is out of the question :)
#33
newLISP in the real world /
August 12, 2005, 08:31:53 PM
Hahaha, yeah, someone pointed that out just a moment ago! I spent a long time trying to find that... :)
#34
Here's the code:



#!/usr/bin/newlisp

(context 'MAIN)

;; Check for a win32 platform

(if (> (& (last (sys-info)) 0xF) 4)
   (begin
      (println "Please run this application under unix.")
      (exit)
   )
)

;; Set constants

(constant   'signal 1
            'release 0
            'wait -1
)

(define (left-hand x)
   (println "left-hand")
   (set 'val 0)
   (while (< val x)
      (semaphore left-semaphore wait)
      (println (set 'val (share data)) "<--")
      (semaphore right-semaphore signal)
   )
   (exit)
)

(define (right-hand x)
   (println "right-hand")
   (for (val 1 x)
      (semaphore right-semaphore wait)
      (println "-->" (share data x))
      (semaphore left-semaphore signal)
   )
   (exit)
)

(define (start x)
   (println "Application Running...")

   ;; Allocate and fill shared memory
   (set 'data (share))
   (share data 0)

   ;; Create Semaphores for both right/left hands
   (set 'left-semaphore (semaphore))
   (set 'right-semaphore (semaphore))

   ;; Start threads
   (set 'left-process-id (fork (left-hand x)))
   (set 'right-process-id (fork (right-hand x)))

   ;; Move left hand
   (semaphore left-semaphore signal)

   ;; Wait for threads to finish
   (wait-pid left-process-id)
   (wait-pid right-process-id)

   ;; And finally, we release the semaphores
   (semaphore left-semaphore release)
   (semaphore right-semaphore release)
)

(start 1000)

(exit)


Now, I've tried to follow the manual yet, the out put of the program doesnt look right:



tmace:/src tmace$ ./semaphore.lsp
Application Running...
left-hand
0<--
right-hand
-->1000
1000<--
-->1000
^C
user reset - in function wait-pid
called from user defined function start
(c)ontinue, (d)ebug, e(x)it, (r)eset:
user reset - in function semaphore
called from user defined function right-hand
called from user defined function start
(c)ontinue, (d)ebug, e(x)it, (r)eset:x
tmace:/src tmace$ -->1000

tmace:/src tmace$


If anyone here could explain what is actually going on, i'd appreciate it.
#35
newLISP and the O.S. /
August 09, 2005, 10:31:20 AM
Score.
#36
Anything else we might add? /
August 09, 2005, 10:28:48 AM
I've never even thought about such a thing, let alone heard of it actually existing. Awesome.
#37
Anything else we might add? /
August 09, 2005, 10:16:06 AM
Just the response I expected. By the way, the author of these accusations, slanderings, and or misunderstandings is the creator of the Factor programming language. And yes, I would have loved nothing more than to argue with this guy, but the stubborness was obvious. He wasn't there to understand Newlisp, rather, he was there to troll (promoting his language along the way).
#38
Anything else we might add? /
August 05, 2005, 12:26:27 PM
Steel Bank Common Lisp -- http://www.sbcl.org/">http://www.sbcl.org/
#39
Taken from a debate in the #newlisp channel on freenode, here was this guy's complaints/arguments:



<someguy> well, newlisp's memory manager really sucks

<someguy> because it doesn't handle shared structure

<someguy> it copies objects when you pass parameters

<someguy> because its inefficient

<someguy> also it means you can't have first-class arrays or hash tables

<someguy> you have to name all arrays and hashes by symbols, and pass symbols, you can't just pass an anonymous hash

<someguy> it severely limits the language

<someguy> performance?

<someguy> sbcl is much faster

<someguy> except the design of newlisp is quite poor

<someguy> and i noticed the flawed memory management, and lack of first-class arrays and hashes

<someguy> more problems in newlisp than high-quality common lisps like sbcl

<someguy> in fact, i don't see anything newlisp is good for

<someguy> i've also looked at the implementation code, its a mess

<someguy> in that sbcl is better in every way

<someguy> it has first class arrays, hashes, real gc, a better object system

<someguy> newlisp is a strict subset of common lisp, except the really broken parts (copying all values when passing parameters, 'contexts')

<someguy> also there's no number tower

<someguy> so integer math overflows

<someguy> that's really bad

<someguy> you can have a file larger than 2gb, but newlisp cannot represent its size

<someguy> algorithms like md5 and sha1 hashing, and rsa crypto all use bignums



I could argue all day with this guy, but in the end, I'm really only interested in Lutz's commentary. So if you wouldn't mind...



Thanks.
#40
Anything else we might add? /
August 01, 2005, 04:20:41 PM
The web-based evaluator, or am I missing something..? (note, I'm not german)
#41
Anything else we might add? /
August 01, 2005, 04:19:06 PM
You're an uncontrollable coding beast.
#42
Whither newLISP? /
August 01, 2005, 04:16:28 PM
You are able to, like Lutz said, define a function without arguments. This, I suppose, would be usefull if you were dynamically creating functions where the number of arguments could be any amount. By using (args), you could get everything.



newLISP v.8.6.0 on OSX, execute 'newlisp -h' for more info.

> (define (myfunc) (println (args)))
(lambda () (println (args)))
> (myfunc "one" "two" "three")
("one" "two" "three")
("one" "two" "three")
>
#43
Anything else we might add? /
August 01, 2005, 04:07:18 PM
If those benchmarks don't show you any contrast, I don't know what will. :) Amazing.
#44
newLISP Graphics & Sound /
August 01, 2005, 04:01:47 PM
You never fail to amaze me.
#45
newLISP newS /
June 20, 2005, 08:41:42 AM
Written in newlisp of course :)