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 - kosh

#1
Anything else we might add? / Re: error in newlisp 10.7.1
September 27, 2020, 10:51:36 AM
Well.. From the looks of it, the code seems to be fine.

And the code is parsed correctly in my environment. Of course the execution will fail, but not raise parse error.


C:>curl -o file.lsp https://pastebin.com/raw/25z78mp3
C:>newlisp.exe .file.lsp

ERR: value expected in function read-line : f
called from user function (fline fh)


How about reinstalling newlisp.exe and newLISP-GS?

Sorry I'm not sure I can think of a better solution.
#2
Anything else we might add? / Re: error in newlisp 10.7.1
September 26, 2020, 11:18:36 AM
1. Could you show me that code?

https://pastebin.com/">https://pastebin.com/, https://gist.github.com/">https://gist.github.com/, etc



2. Also, please make sure again that newlisp.exe supports UTF-8


QuoteC:>newlisp.exe -v


---

I'm not using newLISP GS. However, it doesn't seem to fully support UTF-8.

For example: Run "guiserver/widget-demo-jp.lsp", you can see the garbled text in bellow screenshot



https://i.imgur.com/XPq6Fm7.png">
#3
Anything else we might add? / Re: error in newlisp 10.7.1
September 25, 2020, 10:01:53 AM
Quotefor example I got error like ERR: missing parenthesis : "...oin fline ","))rn(close fo)rn(close f�F�"


Please check that the number of parentheses in the file you are editing is balanced.



It would be safer to edit with an alternative editor (e.g. Notepad++)
#4
newLISP in the real world / Re: Church encoding
July 22, 2019, 03:13:33 AM
lambda.lsp: https://gist.github.com/kosh04/262332">https://gist.github.com/kosh04/262332



This is my newlisp snippet (Incomplete & Comments are written in japanese).

It may be useful something.
#5
newLISP and the O.S. / Re: Installing on Cygwin
December 18, 2018, 07:24:44 AM
Try install icmp6.h included in glibc source manually.



(Cygwin does not provide glibc. see https://cygwin.com/faq.html#faq.programming.glibc">https://cygwin.com/faq.html#faq.programming.glibc)



Example:
$ curl -OLsk https://github.com/bminor/glibc/raw/master/inet/netinet/icmp6.h
$ install -D icmp6.h /usr/include/netinet/icmp6.h
#6
Whither newLISP? / mat BUG
July 26, 2016, 01:33:45 PM
Hello Lutz.



"mat" function returns incorrect value on 64-bit system.

(This problem is confirmed on Windows and macOSX both 32/64-bit)


C:>newlisp -v
newLISP v.10.7.0 32-bit on Windows IPv4/6 UTF-8 libffi.

C:>newlisp -e "(mat * '((1 2 3) (4 5 6)) -1)"
((-1 -2 -3) (-4 -5 -6))

C:>newlisp-x64 -v
newLISP v.10.7.0 64-bit on Windows IPv4/6 UTF-8 libffi.

C:>newlisp-x64 -e "(mat * '((1 2 3) (4 5 6)) -1)"
((1.844674407370955e+019 3.68934881474191e+019 5.534023222112866e+019) (7.378697629483821e+019
  9.223372036854776e+019 1.106804644422573e+020))


Regards.
#7
Quote from: "HPW"But Chrome 47? For me there is only Chrome 46 stated as current.


for details, I use Chrome 47.0.2526.16 beta-m.



http://googlechromereleases.blogspot.jp/2015/10/beta-channel-update_15.html">http://googlechromereleases.blogspot.jp ... te_15.html">http://googlechromereleases.blogspot.jp/2015/10/beta-channel-update_15.html
#8
Thanks. I tried taking benchmark again.



Windows 10 32-bit Intel Core2 Duo CPU L9300 1.60GHz


Microsoft  Edge

>>>>> total time: 4606
>>>>> Performance ratio: 7.70 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)


Internet Explorer 11

>>>>> total time: 14046
>>>>> Performance ratio:23.05 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)


Google Chrome 47

>>>>> total time: 5737
>>>>> Performance ratio: 9.54 (1.0 on MacOSX 10.9, 2.3GHz Intel Core i5, newLISP v10.6.0-64-bit)
#9
I have no idea about How to benchmarking newlisp-js ...



So I tried run "Merge sort benchmark" on newlisp-js.



http://www.newlisp.org/index.cgi?page=MergesortBenchmark">http://www.newlisp.org/index.cgi?page=M ... tBenchmark">http://www.newlisp.org/index.cgi?page=MergesortBenchmark

http://www.newlisp.org/newlisp-js/">http://www.newlisp.org/newlisp-js/



;; try 10 times, and take those avarage
(div (time (dotimes (i 3000)  (mergesort numbers)) 10) 10)


Machine Spec are:



- Windows 10 32-bit Intel Core2 Duo CPU L9300 1.60GHz

- Windows 7 64bit AMD Phenom II X6 1065T 2.9GHz

- Mac OSX 64-bit 1.7 GHz Intel Core i5



- Win 10 MS Edge:         7510.2 ms
- Win 10 IE 11:         160501.7 ms
- Win 10 Chrome 46:       6958.8 ms

- Win 7 Chrome 46:        3449.1 ms
- Win 7 Firefox 41:       2728.1 ms

- OSX Safari:             2815.5 ms
- OSX Chrome 46:          3493.8 ms
- OSX Firefox DevEdition: 2901.6 ms
#10
Quote from: "HPW"Does 'newLISP in a browser' run on MS win 10 browser edge?


Yes. newlisp-js will works fine on Microsoft Edge. I have Windows 10 Insider Preview 32-bit.
#11
newLISP newS / Re: newLISP v.10.6.4 development
September 24, 2015, 08:17:27 AM
Nice work, Lutz.



However newlisp-10.6.4.tgz can not be decompressed.


$ curl -O http://www.newlisp.org/downloads/development/newlisp-10.6.4.tgz
$ tar xf newlisp-10.6.4.tgz
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
$ shasum *
82c51584a894e6f8dc02597d9ddfb68bd836966a  newlisp-10.6.4-OSX-intel.dmg
82c51584a894e6f8dc02597d9ddfb68bd836966a  newlisp-10.6.4.tgz
#12
Whither newLISP? / Can not load empty file
September 16, 2015, 10:31:00 AM
Hi.



A error occurred in loadin empty file. It should be return a nil?


$ touch empty.lsp
$ newlisp
newLISP v.10.6.3 64-bit on OSX IPv4/6 UTF-8 libffi, options: newlisp -h

> (load "empty.lsp")
ERR: problem accessing file in function load : "empty.lsp"
> (eval-string "")  ; passing empty string
nil
#13
Quote from: "Lutz"Thanks for the configure-alt fix. It works now, but on a Windows 7 64-bit systems it also compiles a 32-bit newlisp.exe and without libffi using the TDM GCC 64 toolset.



I am not too concerned about this, as we have working Windows 32/64-bit compilations using the normal configure script and the TDM GCC 64 toolset. It can use the mingw64 to compile 32-bit newlisp.exe with libffi without any error messages. using make winall or make winall64, the executables for the Windows installers are done together with DLLs.


It means that newLISP drop support on previous MinGW32 toolset, and migrate to TDM-GCC 32/64 toolset?
#14
Lutz, Thanks for applying my patch.



I found some other compile problems.



1. configure-alt: still `os_type` is set to WIN_32/64


diff --git a/configure-alt b/configure-alt
index 1994097..d1bfb73 100755
--- a/configure-alt
+++ b/configure-alt
@@ -70,8 +70,8 @@ case `uname` in
  SunOS) true ${os_type:=SUNOS} ;;
  AIX) true ${os_type:=AIX} ;;
  OSF1) true ${os_type:=TRU64} ;;
- MINGW32_*) true ${os_type:=WIN_32} ;;
- MINGW64_*) true ${os_type:=WIN_64} ;;
+ MINGW*) true ${os_type:=WINDOWS} ;;
  OS/2) true ${os_type:=OS2} ;;
  *)
  echo Could not discover your OS platform use one of the following commands:
@@ -100,7 +100,7 @@ elif [ ${os_type} = TRU64 ] ; then
  DEFAULT_CC="${TRU64_CC}"
  DEFAULT_CFLAGS="${TRU64_CFLAGS}"
  DEFAULT_LDFLAGS="${TRU64_LDFLAGS}"
-elif [ ${os_type} = WIN_32 ] ; then
+elif [ ${os_type} = WINDOWS ] ; then
  DEFAULT_CC="${WIN32_CC}"
  DEFAULT_CFLAGS="${WIN32_CFLAGS}"
  DEFAULT_LDFLAGS="${WIN32_LDFLAGS}"


2. newlisp.h: _WIN32_WINNT could not set correctly


$make -f makefile_mingw_ffi
...
gcc -m32 newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o nl-sock.o nl-import.o nl-xml-json.o nl-web.o nl-matrix.o nl-debug.o pcre.o win-util.o wi
n-path.o -lws2_32 -lffi -o newlisp.exe
nl-sock.o: In function `getHostAddr':
c:devnewlisp/nl-sock.c:677: undefined reference to `getaddrinfo'
c:devnewlisp/nl-sock.c:682: undefined reference to `freeaddrinfo'
...
make: *** [default] Error 1


It happends in mingw32 only, not mingw64.



Perhaps _WIN32_WINNT was already defined (maybe 0x0500) in "win-ffi.h" in newlisp.h:114.

As a result, _WIN32_WINNT could not set in newlisp.h:170.
#15
`unpack` function with LIBFFI segfault when variable type "char*" is NULL.


struct string {
    char *ptr;
    size_t len;
};


newLISP v.10.6.2 32-bit on Win32 IPv4/6 UTF-8 libffi, options: newlisp -h

> (struct '_struct_string "char*" "long")
_struct_string
> (setf s (pack _struct_string 0 0))
"0000000000000000"
> (unpack _struct_string s)
Segment fault


I expected following behavior:


> (unpack _struct_string s)
(nil 0)


How to avoid something this?



(It can use `unpack` without LIBFFI. but code will be more complex.)