xkapastel has quit [Quit: Connection closed for inactivity]
groovy2shoes has joined #picolisp
orivej has joined #picolisp
orivej has quit [Remote host closed the connection]
orivej has joined #picolisp
_whitelogger has joined #picolisp
rob_w has joined #picolisp
f8l has quit [Remote host closed the connection]
stultulo has joined #picolisp
stultulo is now known as f8l
mikeyhc has joined #picolisp
<mikeyhc>
Hi all, was wondering if it is possible to replicate something like this scheme code in picolisp: (define (inc) (let ((x 0)) (lambda () (set! x (+ x 1)) x)))
<beneroth>
Hi mikeyhc, welcome :)
<beneroth>
I'm sure its possible. Though as I don't know scheme syntax, I'm not sure what your code does, so I cannot tell you the equivalent in picolisp.
<Regenaxer>
Hi mikeyhc
<beneroth>
You can check rosettacode.org for comparisons of standard programming tasks in different languages, nearly all should have a picolisp entry
<Regenaxer>
sure!
<beneroth>
btw. picolisp has an built-in (inc) function :)
<Regenaxer>
The simple version is (de myInc () (inc (0)))
<Regenaxer>
The general one is
<mikeyhc>
ah, so it would create a closure with x, so calls to the returned function would return an increasing number
<Regenaxer>
(de myInc () (job '((X . 0)) (inc 'X)))
<mikeyhc>
Regenaxer: this is more of a toy example to get familiar with internal function state
<beneroth>
job is picolisp way to create a closure
<mikeyhc>
beneroth: I did but I couldnt quite make it work
<Regenaxer>
The second one is a closure, the first one not
<mikeyhc>
Regenaxer: awesome, thanks!
<Regenaxer>
or use 'curry' as a frontend to 'job'
<Regenaxer>
The first one (inc (0)) is actually self-modifying code, which is *not* frowned upon in PicoLisp
* beneroth
wonders "is it frowned upon in scheme?"
<Regenaxer>
I quite expect so
<mikeyhc>
in scheme you try to stick to functional code, hence set having a !
<Regenaxer>
Or it does not work, as Scheme compiles
<beneroth>
how can a lisp-language frown upon self-modifying code? srsly?
<beneroth>
wow, learned something new :)
<Regenaxer>
Well, in my opinion Scheme is not Lisp ;)
<Regenaxer>
at least when it runs
<beneroth>
an in general opinion? :P
<beneroth>
you're a purist
<Regenaxer>
T :)
<Regenaxer>
Well, when Scheme *runs* it is machine code, which is not Lisp
<beneroth>
not a good argument, as that would apply to every compiled lisp, no? :P
<beneroth>
I don't say you're wrong, but I don't think the general lisp community would use the terms this way.
<beneroth>
not that we care about the general lisp communities opinions ;-)
<Regenaxer>
Yes, I always say so
<Regenaxer>
if compiled, it is no longer Lisp
<Regenaxer>
Most people dont think on that level. They are concious only about the source level
<Regenaxer>
They define "code" as what they *see*, not what it *is*
<Regenaxer>
For me code is what *runs* on a computer
<beneroth>
I know and I think you're right ;-)
<Regenaxer>
:)
<Regenaxer>
relatively right ;)
<beneroth>
I put "I think" in the sentence ;-)
<Regenaxer>
:)
<Regenaxer>
Anyway, mikeyhc, I think what you truely looked for is 'job' in PicoLisp
<Regenaxer>
an explicit closure
<mikeyhc>
Regenaxer: yup, already got something close to what I want working. Thanks!
<Regenaxer>
It is not tied to a function definition as in Scheme. Most cases of 'job' are free s-expressions passed to the GUI or background 'task's
<beneroth>
mikeyhc, you can program purely functional in picolisp. but it also has a very elegant OOP system, which is widely used (e.g. the pil database is based on it).
<beneroth>
also both immutable and mutable programming is supported
<beneroth>
the point is: control to the programmer :)
<mikeyhc>
yup, have ran through all the manual :) just trying to migrate an REST api framework I wrote a while back across
<mikeyhc>
running into a few unexpected gotchas
<beneroth>
cool. good luck and have fun :)
<mikeyhc>
thanks :)
<beneroth>
yeah just come here to IRC and ask whenever you like :)
<beneroth>
which timezone are you based in?
<mikeyhc>
CET
<Regenaxer>
Same here
<beneroth>
same
<Regenaxer>
beneroth, btw, I just remover the (wrong) namespace support from Ersatz
<Regenaxer>
removed
<beneroth>
good
<beneroth>
so currently it has none?
<Regenaxer>
Better none than wrong
<beneroth>
T
<Regenaxer>
yep
<beneroth>
absolutely!
<Regenaxer>
It is overkill for Ersatz anyway
<beneroth>
as long as ersatz is (as the name says) a bootstrap placeholder picolisp version and not a fully supported version.. T :)
<Regenaxer>
right. And something to play on otherwise not supported systems (Windows)
<beneroth>
btw. windows.. Kashyaps approach is probably a dead end (because of POSIX), right?
<Regenaxer>
I think so
<Regenaxer>
We tried already easier ways
<Regenaxer>
(cygwin)
<beneroth>
yeah, as I wrote, we must to the real work, no way around for a usable version :)
<Regenaxer>
But he is very enthusiastic, so good if he has fun
<beneroth>
T
<Regenaxer>
A POSIX version *is* possible, but we have it already with miniPicoLisp and also Ersatz
<Regenaxer>
non-POSIX I mean
<Regenaxer>
plus mini run on 64 bits too
<beneroth>
aye. but the practical applications are rather limited. the language is covered, but not the great perks like pilDB :)
<Regenaxer>
and down to minimal embedded with less than 200 KiB
<Regenaxer>
yes, the interesting things are missing
<Regenaxer>
games/chess.l runs however
<Regenaxer>
$ ersatz/pil games/chess.l -main +
<Regenaxer>
+---+---+---+---+---+---+---+---+
<Regenaxer>
8 |<R>|<N>|<B>|<Q>|<K>|<B>|<N>|<R>|
<Regenaxer>
+---+---+---+---+---+---+---+---+
<Regenaxer>
7 |<P>|<P>|<P>|<P>|<P>|<P>|<P>|<P>|
<Regenaxer>
...
<beneroth>
:)
<Regenaxer>
Slow probably
<beneroth>
bbl
<Regenaxer>
cu
ubLIX has joined #picolisp
ubLX has joined #picolisp
ubLIX has quit [Ping timeout: 255 seconds]
xkapastel has joined #picolisp
ubLX has quit [Quit: ubLX]
rob_w has quit [Remote host closed the connection]
<beneroth>
basically because people develop on x86, so it makes only sense to keep running it on x86, because doing cross-platform or multi-platform work sucks so much.
<beneroth>
so he think success/spread of ARM servers is tied to ARM desktop computers. Which arguably looks rather dark (for non-technical but legacy/historic reasons)
<beneroth>
I think he is right with his reasoning. The same line of reasoning also shows in the strong focus on Linux of picolisp. There is ARM dev hardware available (as Regenaxer and aw- work that way) but that ARM is going to replace x86/amd64 on desktops in significant numbers is rather unlikely...
<Regenaxer>
Probably, yes
<Regenaxer>
On the other hand most developers dont care about the CPU
<Regenaxer>
and dont need. They dont get in touch with that level
<Regenaxer>
BTW, this morning we talked wether Scheme is a Lisp. IIRC even Schemers don't call it a Lisp, but a Scheme
<Regenaxer>
For example, Scheme doesn't have symbols
<Regenaxer>
In the 80s Lisp's was always advertised as a "symbol manipulation language", "list manipulatio" was kind of out
<Regenaxer>
I remember one Professor in Hokkaido who told me the sole important and outstanding feature was *properties*, not lists, macros, closures etc what is in fashion today
<Regenaxer>
Now most people don't even know of symbol properties
<Regenaxer>
and I think it is even not recommended in Lisp any more
<Regenaxer>
(and Scheme even does not support them)
mikeyhc has quit [Quit: leaving]
xkapastel has quit [Quit: Connection closed for inactivity]
<beneroth>
Regenaxer, makes sense
<beneroth>
Regenaxer, yeah I know lisp as the big player in "symbolic computing"
<beneroth>
and yes, my lisp friend (with CL experience and now mostly doing clojure) didn't know about symbol properties :o
<beneroth>
so now I wonder what makes a lang belonging to the scheme family or not. I'll check wikipedia :)
<beneroth>
bbl
DKordic has joined #picolisp
<Regenaxer>
ok
ubLIX has quit [Quit: ubLIX]
xkapastel has joined #picolisp
<beneroth>
back :)
<Regenaxer>
wb :)
<Regenaxer>
Did you notice the book I sent you? I'm now reading it (again, after several years)
<beneroth>
yes, but I have yet to find a way to get it extracted from WhatsApp and onto my tablet or so. Probably usb on pc is enough, but I haven't yet tried ;-)
<beneroth>
Thank you!
<beneroth>
my phone is too old / low-spec to have an software to open it >.<
<Regenaxer>
There are very lightweight readers. You can read it on the phone
<beneroth>
For the next time I can send you an upload link to my file server ;-)
<Regenaxer>
ok
<beneroth>
Samsung Galaxy 2 S from 2011
<beneroth>
any more questions?
<Regenaxer>
No idea :)
<Regenaxer>
I send by mail better then
<beneroth>
battery still holds a day, unless WLAN/telephone is used heavily
<beneroth>
haha
<Regenaxer>
uh :)
<beneroth>
that would work, you should have my address ;-)
<Regenaxer>
sure
<Regenaxer>
moment
<Regenaxer>
Sent, can you check if it worked?
<beneroth>
wikipedia calls scheme: Scheme (programming language), a minimalist dialect of Lisp
<beneroth>
ah
<beneroth>
I thought you meant postal mail xD
<Regenaxer>
haha, no, I dont have it physically
<beneroth>
got it :)
<Regenaxer>
Ok, so it is a Lisp
<Regenaxer>
It is really funny and still enlightening
<beneroth>
wohoo, ok, I put this on my eReader (Kobo, fiddled with the sqlite db on it so I don't have to create an account online to use it)
<beneroth>
thank you, much appreciated!
<beneroth>
I love books
<Regenaxer>
:)
<Regenaxer>
Lots of hacker stuff in that book
<Regenaxer>
and quite correct I think
<beneroth>
good. I look forwarding to read it :)
<Regenaxer>
No hurry
<beneroth>
might take a while, I'm still busy with Asimovs "prelude to foundation" and I just ordered the third part of the 3body series (Chinese SciFi bestseller, not extraordinary but really good)
<beneroth>
:)
<Regenaxer>
good
<Regenaxer>
I should also read Asimov again
<Regenaxer>
haven't since decades
<beneroth>
I really love the robot series. I don't want to discuss AI/robot ethics with people who haven't read it ;-)
<Regenaxer>
yes
<beneroth>
he already found the ideal solutions and also the reasons why they don't work in practice, I think. or at least he forethought already great deal more into that field than the current folks do.
<beneroth>
:)
<Regenaxer>
Ethics dont even work with humans ;)
<beneroth>
aye
<beneroth>
we don't know how to make natural intelligence safe, so not much chance with AI :)
<Regenaxer>
indeed
<beneroth>
Wikipedia about Scheme "It is one of the two main dialects of Lisp, alongside Common Lisp."
<beneroth>
so doesn't matter what the correct academic categorization would be, Wikipedia represents (well) the mainstream understanding of topics :)
<Regenaxer>
hehe, depends who wrote the Wikipedia article ;)
<Regenaxer>
Surely schemers and CLers
<beneroth>
sure. but it's enough close to most peoples understanding that nobody got annoyed enough to change it and keep that change sticking.
<Regenaxer>
Clojure is also called Lisp by some people
<Regenaxer>
In my understanding only CL in these three is a true Lisp
<Regenaxer>
Not important
<Regenaxer>
They all look like Lisp (duck typing)
<beneroth>
parenthesis
<Regenaxer>
yep
<Regenaxer>
For me also cons pairs and symbols are a criterion
<Regenaxer>
So NewLisp seems not a Lisp to me
<beneroth>
does CL have duck typing like picolisp? I really love the strong types and the duck typing of picolisp
<beneroth>
did you ever look into Arc?
<Regenaxer>
Only a few papers
<beneroth>
it seems to be vaporware (never finished)
<beneroth>
it was used for a few things
<beneroth>
but only a few things afaik
<Regenaxer>
Not sure if pil and cl have duck typing, but they are the same in regard of the reader
<Regenaxer>
also Scheme and Clojure
<beneroth>
pil has duck typing on top of strong typing.
<beneroth>
which I find like endlessly better than dynamic typing
<Regenaxer>
But duck typing only in the sense that numbers and symbols are recognized
<beneroth>
but yeah, the point is also if the type is an attribute of a value or of a variable.
<Regenaxer>
Same as C or Java
<beneroth>
pil has duck typing with symbols
<beneroth>
OOP
<Regenaxer>
same as C identifiers
<Regenaxer>
123 is a number in all langs
<Regenaxer>
That *data* have a type is typical Lisp
<Regenaxer>
C does not
<beneroth>
in many of todays languages that number is a float xD
<beneroth>
aye
<Regenaxer>
yes, but recognized by the same patterns in the parser
<Regenaxer>
So I'm not sure what exactly makes up duck typing
<beneroth>
make it "123" and then the mess starts :)
<Regenaxer>
" and ( are syntax
<Regenaxer>
meta chars
<Regenaxer>
also in all langs
<beneroth>
yes, but some languages will say "123" is a number and some will say its text :)
<Regenaxer>
right
<Regenaxer>
they are more true duck typers then
<Regenaxer>
shell
<Regenaxer>
perl
<beneroth>
As I understood it, duck typing is mainly focused on argument handling in functions: if the given input quacks like a duck, walks like a duck, then we handle it as if it would be a duck (because it's enough a duck for all what we - our function - cares)
<beneroth>
the opposite would be the requirement to do type castings to get an argument accepted :)
<beneroth>
that annoys me a lot in C#
<Regenaxer>
ok
<beneroth>
lot of extra work and extra code to get around the type systems - for legitimate workarounds. C# just wants this to be explicit-
<beneroth>
does my understanding of duck typing sound right?
<beneroth>
"to determine if an object can be used for a particular purpose. "
<beneroth>
"With normal typing, suitability is determined by an object's type. In duck typing, an object's suitability is determined by the presence of certain methods and properties, rather than the type of the object itself."
<Regenaxer>
yes, though values in general
<Regenaxer>
not only args
<beneroth>
T
<beneroth>
the wikipedia makes a strong association with OOP
<Regenaxer>
So pil is not duck then
<Regenaxer>
the data have a fixed type
<beneroth>
on the lowest level, yes
<beneroth>
but on the level of OOP objects.. they're all symbols, but of different types (classes), but it might not matter :)
<Regenaxer>
Not really important too. Just a term
<beneroth>
T
<Regenaxer>
yes
<beneroth>
and FEXPR
<beneroth>
they can do a lot duck-handling :)
<Regenaxer>
right, on a higher level
<beneroth>
throw in what you want in whatever order you want - no problem, if the FEXPR finds it ducky enough for its function
<Regenaxer>
not just single data pieces
<Regenaxer>
T, it can interprete what it gets
<beneroth>
I think it's absolutely correct to call picolisp a "strong static" typed language that supports duck typing
<beneroth>
?
<beneroth>
hm
<Regenaxer>
Problem is people confuse it
<Regenaxer>
Static implies static checks
<beneroth>
T
<Regenaxer>
looking at static code
<beneroth>
we don't have static checks
<Regenaxer>
which is the opposite of pil
<beneroth>
but we have guarantee that a value does never change its type
<beneroth>
I think that also falls under "static typed" but I'm not entirely sure on that one
<Regenaxer>
I had thought not
<beneroth>
you are probably right
<beneroth>
so "strong duck typed" ? :D
<Regenaxer>
"static typed" always means variables and function sgnatures
<Regenaxer>
hmm
<Regenaxer>
I dont know a term for "typed data"
<beneroth>
"The Lisp family of languages are all "strongly typed" in the sense that typing errors are prevented at runtime."
<Regenaxer>
ok, true
<Regenaxer>
"runtime" is the point
<beneroth>
"Assembly language, Forth can be characterized as untyped. There is no type checking; it is up to the programmer to ensure that data given to functions is of the appropriate type. Any type conversion required is explicit."
<beneroth>
hm
<Regenaxer>
yes, and in C only the compiler checks, not the runtime
<beneroth>
many concepts just don't make really sense when looking at picolisp concepts xD
<beneroth>
"many traditional software language concepts"
<beneroth>
I mean
<Regenaxer>
yes, cant be pressed into rigid corsetts
<beneroth>
aye
<beneroth>
too way out of the box :)
<Regenaxer>
also terms like "call by value" or "call by ref"
<Regenaxer>
pil is both
<beneroth>
so is C/C++, and also java
<beneroth>
C# too
<Regenaxer>
right
<Regenaxer>
a sufficiently powerful lang supports all
<beneroth>
its a bit hidden from the programmer in C# and Java, with the result that the programmers are often not aware what they do when they should be.
<Regenaxer>
yep
<beneroth>
in my formal education, we got teached C but without pointers, as "we will not need them anyway for java which we will do next". consequently, the main bug was "null pointer exception" and the things people didn't understand was array (by value) vs. ArrayList (by ref, vector in C++)
<Regenaxer>
haha
<beneroth>
fortunately I already learned C++ before I started going into IT :)
<beneroth>
I still profit from what I learned myself in C++ (my first lang and my first thing with computers=
<beneroth>
)
<beneroth>
"C++ für Spieleprogrammierer" by Heiko Kalista. Excellent book. And I met the author once :)
<beneroth>
German
<Regenaxer>
I believe, C++ is still close enough to the machine
<beneroth>
C++ is good for learning. you get it right, or it blows up. Not so ideal for productive business app development.
<Regenaxer>
T
<beneroth>
Java is (arguably) good for business app development: you can screw up a lot and it still kinda does something not entirely completely wrong.
<beneroth>
bad for learning. you are not enforced to understand what you do.
<Regenaxer>
Agreed, Java is everything and nothing
<Regenaxer>
not high and not low enough
<Regenaxer>
So the worst of all worlds
<beneroth>
I only later found out that C++ (I also learned and had great fun with templates) is considered difficult. most trouble I had in education was with html - no logic, too much arbitrariness for me.
<beneroth>
dunno if I'm just gifted or just had the luck to approach the stuff from a more beneficial angle. but I suspect it's more of the second than of the first.
<Regenaxer>
Whats even worse is CSS (at least I see no logic)
<beneroth>
haha, yeah.
<beneroth>
it got better
<beneroth>
well both HTML and CSS got better :)
<Regenaxer>
ok
<beneroth>
I find
<Regenaxer>
probably
<beneroth>
html5 and CSS3 compared to html1999 and css1/2
<Regenaxer>
And I just dont know enough about the principles of CSS
<beneroth>
html became more an semantic language.
<Regenaxer>
but the outcome is never as I expect
<beneroth>
well, it is a mess :)
<beneroth>
CSS is a rulework to say "set on that symbols the properties to that value". but in a messy abstract-vs-granular way messing each other up :)
<Regenaxer>
I dont understand the "cascading" part
<beneroth>
and html elements like <navigation> and <article> did even now not really catch on. and they killed <keygen> :(
<beneroth>
against protest from Tim Berners-Lee himself.
<beneroth>
cascading = automatically applying to nested elements. but in practice it has some catches. or something like that.
<beneroth>
I think the problems are, as so often, the perverse economic incentives.
<Regenaxer>
yes, block elements etc
<Regenaxer>
hmm, sorry, must stop
<beneroth>
website publishers don't really profit if their websites are simple and well structured so they can be both easily be consumed by humans and machines.
<beneroth>
ok
<beneroth>
no problem
<beneroth>
have a good evening :)
<Regenaxer>
See you soon!
<Regenaxer>
you too!
<beneroth>
I try to finish a monster project now :)