freenode/#lisp - IRC Chatlog
Search
5:59:09
aeth
but I guess roswell is the way to go to quickly test a library on as many implementations as possible with "ros use foo; ros emacs &"
10:02:39
fourier
i did some simple tests against hand-written loops and purely functional approach to the same problems (like sum of squares of a list of numbers) and was surprised what the code generated by series is as performant as hand-written loops and at least twice more performant than pure functional approach with reduce/map
10:05:46
Fare
whereas naive map/reduce sees its arguments as opaque and must do a lot of "administration" at runtime
10:07:32
fourier
series basically generates loops with (go) out of composition of expressions. cool what it is generate as performant code as hand-written loop while still using functional approach.
10:09:48
fourier
yep functional approach lead to creating intermediate lists after applying remove-if/subseq etc, which definitely hits the performance
10:15:01
jmercouris
Hey everyone, I just released version 0.06 of nEXT Browser https://www.reddit.com/r/lisp/comments/7kd3xu/next_browser_version_006/
10:15:29
jmercouris
If you like my project, please consider leaving a star, I'll be working on the GTK port in earnst for the next release, so any help in this domain would be greatly appreciated!
10:21:29
jmercouris
I also would be extremely interested if any users have any feedback, please feel free to contact me via any medium
10:21:54
jmercouris
unless it's something like smoke signals, in which case I cannot guarantee reception
10:27:57
beach
I see some code duplication between history-add and history-typed-add. You might want to create a common abstraction for those.
10:29:08
jmercouris
beach: Yeah, there's some macro that allows you to use the database, but I couldn't figure it out how to work
10:29:33
jmercouris
so you can normally do something like (with database ...) and it'll be like a context thing
10:30:04
jmercouris
Maybe, I would like to figure out the proper way actually, the way the lib wants you to do it
10:30:34
jmercouris
I have to go cook breakfast now, but I'll be back/read anything, thank you for the suggestions thus far
10:32:59
jmercouris
beach: One other thing, I wanted to make a (with-new-buffer) macro, but I couldn't think of a good way to do it
10:33:12
jmercouris
a lot of my functions involve acting on the current buffer, and then there is a derivative acting on anew buffer
10:33:45
jmercouris
beach: It is in parenscript, so I'm very hesitant to write earmuffs, not sure if they are supported in JS, but I try
10:33:48
beach
Yes, I am not reading the code in order to understand what it does. Just doing superficial stuff.
10:34:07
jmercouris
beach: Fair enough, that is also still very useful to me, I miss a lot of things as you can see :D
10:37:36
beach
If so, don't write (WHEN CHILDREN ...) because WHEN suggests that it is a Boolean value. I would write (UNLESS (NULL CHILDREN) ...) instead, as Norvig and Pitman suggest.
10:38:21
beach
And you need to work on your LOOP indentation. I suggest you use SLIME-INDENTATION to get it right.
10:39:23
beach
Furthermore, you have inconsistent LOOP formatting. Sometimes you have DO at the end of a line, and sometimes at the beginning. It is best to put it at the beginning of the line that starts the clause.
10:42:06
Zhivago
Although to be honest, if you want to talk about a list being empty, I'd write (when (empty children) ...) -- null is quite semantically overloaded, too.
10:46:08
|3b|
fourier: same meaning to lisp implementation, but might be interpreted differently by human readers
10:46:42
|3b|
ACTION personally finds (when x ...) easier to parse than (unless (whatever x) ...) though
10:48:05
Zhivago
fourier: You can think of it (when children ...) being an implied (when (true children) ...).
10:48:52
Zhivago
Personally I think if you're happy with overloading null, then you might as well be happy with overloading it in the opposite direction.
10:50:26
|3b|
yeah, i think UNLESS EMPTY is better than UNLESS NULL for me, but still worse than just WHEN
10:50:49
|3b|
ACTION probably wouldn't tell people to change any of them though, since that's just 'for me' :)
10:51:46
beach
fourier: It has nothing to do with semantics and everything to do with the intention as communicated to the reader of the code.
10:52:54
Zhivago
And since C has no common list structure this is more important to communicate perhaps than in CL.
11:02:22
borodust
indentation in emacs CL (via slime) buffer is often breaks for me if there are docstrings present
11:02:35
fourier
i got a feeling what it mostly relevant for string variables,, which could either be null or "". I use alexandria:emptyp for this case then (unless (emptyp arg)..)
11:04:51
beach
Also for docstrings, I use #.(format nil ...) so that I can use ~@ at the end of lines and indent the next line without affecting the docstring.
11:09:49
Shinmera
borodust: Parens at the beginning of lines within strings or comment blocks screw with SLIME
11:26:08
jmercouris
Ok, so I'll always put do on the line with the clause, that's a good rule to have
11:26:31
jmercouris
In terms of the when, unless not, I always prefer not using double negatives, so that one I will have to consider for some more time
11:26:58
jmercouris
In terms of indentation, I don't like always what slime is doing for me, especially in parenscript, it has some strange behavior sometimes
11:27:41
beach
I take it most people in #lisp are not used to collaborative programming. I guess that's kind of normal in some way.
11:30:15
jmercouris
I am very used to collaborative programming, that's why I'm such a huge fan of standards
11:31:05
jmercouris
In python one should only care about the truthiness, and I think that's a good way of doing things
11:32:12
beach
jmercouris: Notice how you say "I always prefer", "I don't like", "I think that's a good way".
11:33:59
beach
jmercouris: That you claim to be in favor of standards, but then you have several objections that indicate that your personal preference if more important.
11:34:35
jmercouris
beach: I think you're right I should reconsider my objections, thank you for pointing out this inconsistency
11:34:51
beach
jmercouris: Look, I don't care how you write your code. I gave you advice that corresponds to what two great Common Lisp gurus have written. If you don't want to follow it, then that's fine with me.
11:35:19
jmercouris
beach: I understand you have no stake in it, which is what makes your opinion objective and useful, you don't have to remind me of that
11:35:54
jmercouris
I am always ready to admit when I am wrong, which is unfortunately too frequently :D
11:37:40
jmercouris
shka: being wrong is fine, being stubborn is the worst, and being correct is the best ;)
11:38:37
|3b|
ACTION thinks being stubborn isn't too bad when you are right, but since you tend to think you are right when you are wrong, any blanket rating of stubbornness isn't much use :)
11:45:02
jmercouris
Zhivago: that it is, I was not lying about my position :D, but it is true that I should be more open to reconsidering some of my opinions if they conflict with some of the best lisp devs
11:45:31
jmercouris
maybe in the end I will not agree, but I should give them a more thorough consideratio
11:53:42
Tota|Ev613
▄▄▄▄▄▄▄▄▄▄▄▄▄ HAPPY NIGGER DAY!! PLEASE SAY HI TO ALL THE DUMB NIGGERS IN #FREENODE...quicktalkeh676te.onion/6697dsyhmwnj: jack_rabbit Fare holycow ericmathison heurist` oleo Zhivago MochaLoca wheelsucker nullman Mon_Ouie davsebamse shka kozy mishoo_ josemanuel d4ryus1 _Trasformatore_ wigust nirved FreeBirdLjj smurfrobot cpape pmetzger damke_ raphaelss nydel nalkri atgree
11:55:31
jackdaniel
there must be systematic problem causing this, becuase number of people loosely called trolls raises and I'm not only talking about the internet
11:55:55
jackdaniel
something not quite right with the society directions I'd say, if it were #lispcafe ;)
12:06:00
xenon-
I guess I might as well ask if there's a function that does this? :). (lambda (x) (* (signum x) (floor (+ (abs x) 0.5))))
12:10:31
|3b|
ACTION doesn't think so, not sure if (truncate (+ x (* 0.5 (signum x)))) is any better (or whatever it is if i didn't get that right)
13:47:53
jmercouris
This isn't exactly a lisp question, but I've been thinking about how to monetize nEXT so that I can work on it full time, and one idea that I had was this: opt-in crypto mining, something like, "If you want to support nEXT development, please install/configure miner plugin" and I could have a really well made plugin that can be set to use only up to 5% cpu, only during specific times, etc, so that if a user wants to help, they can
13:49:41
jmercouris
Shinmera: It really depends on which coin you are mining and how you are trading things
13:50:03
jmercouris
You are right, if I only have 50 users, it may not make any money, but if I have 1000 users, maybe I can make like 500 a month or something
13:54:02
jmercouris
Zhivago: :D, there will be a crash as there has been many times before, but I think there is a future in cryptocurrency
13:54:44
jmercouris
Yes, bitcoin has a lot of problems, but that is not the essence of my question, I didn't even mention bitcoin
13:55:14
Zhivago
If you had an app which you could buy for $1 which unlocked some features, then that might be below the threshold of annoyance for users.
13:55:47
Zhivago
I'm unlikely to pay money to someone via ebay, but I'm at the point where I don't find it unreasonable to unlock something in an app for $1.
13:55:58
jmercouris
fourier: I will at some point, I am trying to get a new contract job soon, but I would like to try to make it work at some point
13:56:15
Zhivago
Simply because the infrastructure makes it easy to do so rather than an enormous pain in the arse.
13:56:51
borodust
Xach: howz your experience with trivial-gamekit so far? was the documentation of any help? any hard edges?
13:56:53
Zhivago
If bitcoin gets to that stage, we'll be using all of the planet's power production on bitcoin computation.
13:57:17
pjb
Not really, and you're forgetting to compare the power consumption of the current banking system.
13:57:23
jmercouris
Zhivago: I've always felt that crypto was so ecologically irresponsible, we are just wasting cycles on bullshit
13:57:37
fourier
then think about casual users and not about lispers. what advantages your browser has to someone to donate/pay for it, considering chrome, firefox, opera, etc are widely available
13:57:39
drdo
pjb: Damn, I missed your "eventually" when glancing and almost believed you with the crazy growth that has been going on lately
13:58:38
pjb
jmercouris: it's expensive to maintain a distributed network of workers. Really, it's not that simple.
13:58:58
jmercouris
I have been thinking so far about this: the ability to send pages with marked up to non nEXT users, backups for bookmarks, history etc, synchronization of data across devices
14:00:08
jmercouris
maybe I should just sell corporate licenses, and hope that people use it in their place of business :D
14:00:47
jmercouris
Another idea that I had recently was an "opt-in" amazon affiliates, like some simple config you can add so that you are using my amazon affiliates code to support nEXT
14:02:04
fourier
maybe smart tabs/window management. like group all stackoverflow tabs to one window etc
14:02:37
Zhivago
You paid $1000 and could show people an icon of a diamond, which gave users a sense of pride and accomplishment in being rich enough to waste $1000 on an icon of a diamond.
14:02:48
jmercouris
fourier: That would be very simple to implement given my current architecture, anyone could just make a plugin that does it
14:03:27
jmercouris
Yes, but I can't charge them for something they could make themselves in 10 minutes lol
14:03:34
pjb
Also, nowadays people don't use desktop browsers anymore; they browse the web on tablets and handheld computers, where energy consumption is closely watched. If you app drains the battery, it'll get deleted soon.
14:03:56
jmercouris
pjb: It is a desktop only browser, it is made for actual work, not for "browsing"
14:04:13
jmercouris
Zhivago: Yes, I guess if they were me :D, perhaps a different person would spend a couple days
14:05:29
fourier
as for us lisp nerds it would be cool if you build it in as a plugin to say Climacs and Lispworks, to popup and show clhs in it real quick and easy :)
14:06:17
fourier
beach: how is Climacs now? is it usable for CL code now, can it replace emacs+slime for simple usage patterns?
14:08:31
jmercouris
One last final thought I had to sound off you guys, I was considering making "paid plugins" that do things that would mostly only be interesting to someone using nEXT in a corporate environment, things like single sign on integration, VPN integration
14:09:32
pjb
Ie. you're not selling a browser, you're selling a solution to a specific corporate problem.
14:09:40
jmercouris
I was imagining such a customer would be someone who works at a startup that uses my browser
14:09:57
jmercouris
and they want to use it for all of their stuff at work, so they need some support for a few things
14:12:26
fourier
jmercouris: can I install it from quicklisp and launch off my CL? so I can use my repl to operate/controll it
14:15:34
jmercouris
fourier: please note, MacOS only at the moment, I'm learning/working on the GTK port
14:15:54
jmercouris
fourier: reading this should give you an idea of how you could run it: https://github.com/nEXT-Browser/nEXT/tree/master/next#developer-installation
14:16:17
jmercouris
fourier: sorry, wrong link, this is what I meant: https://github.com/nEXT-Browser/nEXT/tree/master/next#run-from-source
14:28:03
fourier
jmercouris: on my attempt to load it this way I got an error: Error: Can't create directory "/Applications/Clozure CL.app/Contents/Resources/ccl/mac-ui/".
14:29:48
pjb
alternatively, patch it to use a different target directory for compilation and generation of temporary files.
14:32:36
jmercouris
fourier: You don't actually have to compile it to load and play with it via slime, you can also download the DMG and start a swank server you can connect to: https://github.com/nEXT-Browser/nEXT/blob/master/documents/MANUAL.org#slime-with-a-compiled-version-of-next
14:34:21
fourier
no I was thinking mostly of using browser as a part of lisp image, i.e. to present html documentation in the CL-based app.
14:34:58
jmercouris
fourier: then you will probably want to install CCL not with the mac app, but with the "manual" installation
14:35:23
Shinmera
Loading a huge system just to show some docs doesn't seem like a great course of action
14:35:50
jmercouris
Shinmera: Huge system? I pull in VERY few dependencies, and all the libraries for Cocoa/Webkit exist natively on OSX
14:36:44
jmercouris
Adding nEXT to any existing CCL image will add probably AT MOST a few KB to the image, though I haven't tested it to be sure
14:40:47
Zhivago
jmercouris: Looking at nEXT, it's not really clear to me what real-world problem it solves.
14:43:22
jmercouris
Zhivago: The problem next solves is that it gives power users a way to tailor and extend their browser to their workflow to be more efficient in ways that are currently (and probably never will be) possible in casual browsers meant for general-purpose browsing
14:44:40
jmercouris
Zhivago: As an example, let's say your job requires you to fill out a web-form with the date all the time, and there are maybe 30 of these web-forms linked from a master page. You could write a plugin that opens 30 new tabs with all of the forms, enters the current date, and then maybe some other functions for populating the forms with data
14:45:02
jmercouris
Zhivago: Yes and no, Javascript is limited only in that it can change the web-view itself, nEXT allows you to manipulate and change the Chrome in ways that JS does not
14:45:33
jmercouris
Zhivago: So you might make a plugin that changes the transparency of unrelated windows, or opens up 10 new frames, or executes some lisp code on your machine, etc
14:45:46
Zhivago
Ok, although we can already do that using a programmatic browser -- and those are used a lot of scraping.
14:46:41
jmercouris
Zhivago: Maybe you could, but this is just the main difference of nEXT, the other great thing is that this environment has enabled me to develop a lot of very cool extensions very quickly to just make one quicker at browser than in general, the combination of all of these plugins together is what makes it better than something like Chrome
14:47:09
jmercouris
Zhivago: Additionally, nEXT is not beholden to some arbitrary plugin ecosystem that can decide "NO MORE API FOR YOU!" as we witnessed in the Firefox Apocalpyse
14:47:57
Zhivago
Fair enough. So browser automation, then. I assume that it runs javascript like a proper browser? :)
14:48:22
jmercouris
Zhivago: Yes, though I refused to put any JS directly in my codebase, and anything I'm using JS for is written in parenscript macros
14:48:54
jmercouris
s/written in parenscript macros/written in macros that generate parenscript from parenscript source
14:49:18
Zhivago
I think you need to work on writing this down for your site, since reading it doesn't make it very clear.
14:50:18
jmercouris
Zhivago: The marketing message is a little confused indeed because I am trying to target too many audiences at once, on one hand, I would be very glad to have the support of the lisp community as they will be the chief innovators/users of the product, and on the other hand, I want to make sure that people who haven't used a productivity-centric browser can understand the advantages it may confer to them
14:51:07
jmercouris
Zhivago: If you have better ideas for a marketing message, please send me an email or make a pull request, I did have a very nice user contact me the other day with a message, I need to look it up/ will repost it shortly when I find it
14:52:55
jmercouris
Zhivago: Here's the message the guy came up with: nEXT is a keyboard-oriented, extensible web-browser inspired by Emacs and designed for power users. The application has familiar key-bindings, is fully configurable and extensible in Lisp, and has powerful features for productive professionals.
15:05:45
Xach
borodust: however, i need to work on having proper expectations and understanding of how things work before reporting things as bugs
15:06:02
beach
fourier: (first) Climacs works, but it isn't good enough for what I want. So I am working on Second Climacs, which will have a much more sophisticated incremental analyzer of Common Lisp code.
15:11:11
Xach
borodust: i started a window with a little demo code that draws a square at the mouse cursor. when i close the window and try to re-start it, i end up in the debugger.
15:18:38
borodust
Xach: ah, i see, it isn't quite stable in this regard at this moment and there known problems when engine is restarted several times per image (probably due to a resource leak). Does this still happen if you close window with #'gamekti:stop?
15:20:11
borodust
Xach: also, I recommend binding input inside #'post-initalize function https://borodust.org/projects/trivial-gamekit/manual/#gamekit-post-initialize
15:30:56
Xach
borodust: gamekit:stop allows for restarting. closing the window with the window controls does not. (this is with latest updated dist)
15:37:26
borodust
Xach: it will probably reappear if you try to close window and call #'start around the same time
15:59:26
jmercouris
Goal: Move element to the beginning of list, What would be the better approach: Make a copy of the list with the element in the first position, Modify list in place with car/cdr, Anything else?
16:03:31
jmercouris
That's a good question, I'll give some more specifics, the list is between 0-50 elements, frequently changing in size
16:03:48
beach
If the element is already at the beginning, do nothing. Otherwise, find the CONS cell that precedes the one containing the element. Short-circuit the list using (setf cdr). Finally link the unlinked cell to the beginning of the list.
16:04:35
pjb
Can it contain duplicates? Is it shared (do you have multiple references to its cells)? Are there multiple threads accessing it in parallel?
16:05:28
jmercouris
pjb: There is only one master reference to this list, no one may delete something from this list without using this lists reference
16:05:38
beach
Or, if you don't care about the order of the remaining elements, swap the first element with the one you want to move.
16:06:30
jmercouris
I think the term is something like spatially recent, it's on the tip of my tongue
16:07:00
jmercouris
pjb: The threads have reference to the individual elements, I would rather not create/destroy the elements, only change the list itself
16:07:26
pjb
jmercouris: also, you said that the size changes. How (what thread) do you remove elements?
16:08:35
jmercouris
so I always do something like this (setf listy (delete delete-this-element listy))
16:09:09
pjb
If you already use delete to delete them, then (setf list (cons element (delete element list))) would be a consistent way to move it to the front.
16:09:46
jmercouris
Well, this operation is not executed more than lets say once a minute, and the list is small
16:10:45
jmercouris
but if the elements within the list are large, does this affect the speed of the creation of the list? I cannot see why it would, but maybe there is something I dont know
16:11:40
jmercouris
Yeah, I have a reference always to the item I want to move, so I can leave it at eql
17:38:42
dim
oh, or maybe you mean something else, I use Github Pages but with a local static HTML toolkit: gohugo (used to be home made CL code but I don't care about maintaining that)
17:38:56
fourier
```lisp does not really work for me... maybe theme prevents it ? i'm using minima theme.
17:48:05
jmercouris
1. I have a GUI that has a textbox, 2. I can only prompt the textbox for its value, 3. I recieve all keystroke events in my program 4. I want to make a blocking read/input function similar to on a terminal, 5. do you think I should use a semaphore to do this?
17:51:43
shka
but don't create more threads then you need (that would be one for GUI and one for internal logic)
17:53:21
jmercouris
Here's what I am doing: https://gist.github.com/944e60992fd391fc9008485788342ce6
17:55:18
jmercouris
So, my current solution is entirely non-blocking because I pass a reference to a function which I call at some point in the future
17:55:30
jmercouris
I think that a blocking input solution is good for a lot of simple little functions
17:57:03
shka
blocking threads leads to more threads, more threads leads to more locks, more locks lead to problems and performance degradation
17:57:49
fourier
should you maintain a stack of ui elements, whoever on top should receiev all events and propagate to the next on stack if they are not consumed?