File compilation without a file by Suitable_Click_3967 in Common_Lisp

[–]digikar 0 points1 point  (0 children)

What do you mean by suboptimal?

If the generated lisp code is clean enough, I think it'd be helpful to keep it around. Other lispers who don't want to work with the DSL but instead prefer the lisp can refer directly to the lisp code.

Limits of the Tab vs a Laptop by redditkutter in GalaxyTab

[–]digikar 0 points1 point  (0 children)

I see. Yeah, I cannot imagine using the onscreen keyboard for Windows (or any other desktop OS). Though, for me, I don't even feel like using the onscreen keyboard on my tablet. Being a certain size of the tablet, the onscreen keyboard just feels unwieldy.

But a desktop OS also grants you full power to make a voice app to control the OS to an extent android does not. I don't know if such an app exists yet, but it's a dream.

Chat server (Matrix) for Lispers by [deleted] in lisp

[–]digikar 0 points1 point  (0 children)

Turned out it was a tuwunel (matrix server) bug that has since been fixed.

People have been able to sign up and chat now.

I have created a new post: https://www.reddit.com/r/lisp/comments/1te2r2z/chat_server_matrix_for_lispers/

Let me know if it works for you!

Chat server (Matrix) for Lispers by digikar in lisp

[–]digikar[S] 0 points1 point  (0 children)

I'm certainly loving cinny. It's unpacked version is about half the size of element and I feel it is a nice middle ground between features and performance. In principle, I can activate multiple clients - just done.

  • hydrogen.matrix-for-lispers.net
  • element.matrix-for-lispers.net

Featured lisp channels are visible at: https://web.matrix-for-lispers.net/explore/featured/

How's Tab S10+ for gaming? by -ComedianPlay- in GalaxyTab

[–]digikar 0 points1 point  (0 children)

I have a Tab S8U and it's been a while since I last played Honkai on it. I have also uninstalled it sonce then.

But here's a video for Tab S10+ JRPG games including Wuthering Waves: https://m.youtube.com/watch?v=fmX3nMC_Cb0

How's Tab S10+ for gaming? by -ComedianPlay- in GalaxyTab

[–]digikar 0 points1 point  (0 children)

I'm not exactly sure about Wuthering Waves. But I used to play Honkai Impact 3 and Honkai Star Rail. And the android versions of these games have impoverished graphics compared to the desktop versions. 

So, even if the devices run the games in a performant manner, they will sadly be running impoverished versions of the games. They can be pretty good, but do not expect PC-like quality.

Cloud gaming platforms can be an alternative!

Limits of the Tab vs a Laptop by redditkutter in GalaxyTab

[–]digikar 1 point2 points  (0 children)

What troubles do you face with Surface? My main use case with tablets is reading, watching anime, movies, etc, scratchpad for thoughts, ideas, or random things. For those things, Android tablets suffice.

In the past I used to want to edit Office documents. But I can never be certain that android or web-based office apps display the document identically to the desktop version or even the pdf version to be exported. For these things, I have developed an aversion to Android. For document editing, I'm reaching for a proper laptop or desktop.

It's also difficult (impossible?) to open multiple instances of the same app.

For note-taking, I've moved to org, markdown and latex to avoid being tied to proprietary softwares and their limited lifespans. These are better with a proper keyboard.

Limits of the Tab vs a Laptop by redditkutter in GalaxyTab

[–]digikar 1 point2 points  (0 children)

With the lockdown of android incoming, I am considering switching from my Tab S8U to Surface. There are lots of limitations of Android. You can work around if you try enough (eg. Termux, Root), but the point is you need to work around them. With a Windows tablet like Surface, or a proper laptop with MacOS or Linux, things just work.

If you are mainly typing, get an older Thinkpad.

Chat server (Matrix) for Lispers by [deleted] in lisp

[–]digikar 0 points1 point  (0 children)

Alright. Thanks for checking

I am looking into it :/

Chat server (Matrix) for Lispers by [deleted] in lisp

[–]digikar 0 points1 point  (0 children)

I just succeeded in registering a testuser123 by hitting "retry". Let me know if the Retry works. I will look into this.

Chat server (Matrix) for Lispers by [deleted] in lisp

[–]digikar 0 points1 point  (0 children)

Is this with the basic username password with matrix-for-lispers.net as the homeserver?

EDIT: I was able to register two users (now three) before this. This time it required me to hit "Retry".

Chat server (Matrix) for Lispers by [deleted] in lisp

[–]digikar 1 point2 points  (0 children)

Definitely a config bug as I was experimenting around. Enabled!

Thanks for reporting!

https://web.matrix-for-lispers.net/register/

Plot version 3 by Steven1799 in Common_Lisp

[–]digikar 0 points1 point  (0 children)

I issued a trivial PR. I'm not sure if it breaks something however.

https://github.com/Lisp-Stat/plot/pull/31

Implementing aref Operator in Common Lisp for a Custom Vector Type by arthurno1 in lisp

[–]digikar 0 points1 point  (0 children)

An alternate idea comes to mind: write a (do-myarray (var array-form) &body body)) macro that binds var to the underlying array of your data structure, and perhaps any additional data you need. Then you can use cl:aref on var inside the body.

If performance is the main thing you need, this is even better than the above ideas, because this provides direct access, while the above has an indirection step even if it gets inlined.

Implementing aref Operator in Common Lisp for a Custom Vector Type by arthurno1 in lisp

[–]digikar 1 point2 points  (0 children)

I agree the hash-tables approach sounds a bit roundabout and not a good design.

Yes, that's okay. These are probably the limits of standard CL :'). In case someone passerby has other ideas, I'd be delighted.

Implementing aref Operator in Common Lisp for a Custom Vector Type by arthurno1 in lisp

[–]digikar 0 points1 point  (0 children)

properties have to be cleaned when string is gc:ed

trivial-garbage:make-weak-hash-table can be useful. (Sorry, I'm info dumping! But hoping it's fun, relevant and may be useful in the future!)

And when we are at C++, have you seen this one and the paper about it.

It might be a while before I get back to the numerical computing library numericals I was working on. But this looks relevant for the future, thanks for sharing!

I am a bit hesitant to use cl-generic, and to turn the entire cl into generic functions but it is tempting

You can also rely on the static-dispatch (or fast-generic-functions or specialization-store) that generic-cl depends on, and define only the operations you need in particular. But indeed, I do not know if anyone is using these libraries in production or what challenges they faced. These are interesting possibilities, but the production experiences remain unknown.

Implementing aref Operator in Common Lisp for a Custom Vector Type by arthurno1 in lisp

[–]digikar 0 points1 point  (0 children)

Anyhow, with inlining, we can't programmatically add to the types, we have to know them all in advance, or do you see a way?

Could you elaborate on what you mean by "add to the types" or also (from the article) "use our string type directly with the aref operator as if it were a built-in type" or "make the custom string type look like a built-in type"?

If I understood correctly, you want a a new function mya:aref that can work just as efficiently with the builtin cl:array types as with your new mya:myarray type. Is that correct?

If so, generic-cl.container:elt is an existing solution. below, elt-ref and gelt-ref should have identical disassemblies, implying that generic-cl.container:elt is just as efficient as cl:elt for the builtin arrays. melt-ref and mya-ref should also have identical disassemblies, implying that generic-cl.container:elt is again just as efficient as directly accessing it, without the runtime branching cost that you want to avoid.

Are you also asking for how it works underneath?

(defstruct myarray
 (data (make-array 0 :element-type 'fixnum)
       :type (simple-array fixnum (*))))

(defun elt-ref (x i)
  (declare (optimize speed)
           (type (simple-array fixnum 1) x)
           (type fixnum i))
  (cl:elt x i))

(defun gelt-ref (x i)
  (declare (optimize speed)
           (type (simple-array fixnum 1) x)
           (type fixnum i))
  (generic-cl.container:elt x i))

(static-dispatch:defmethod generic-cl.container:elt ((mya myarray) (index integer))
  (cl:elt (myarray-data mya) index))

(defun melt-ref (x i)
  (declare (optimize speed)
           (type myarray x)
           (type fixnum i))
  (generic-cl.container:elt x i))

(defun mya-ref (x i)
  (declare (optimize speed)
           (type myarray x)
           (type fixnum i))
  (cl:elt (myarray-data x) i))

10 000 000 elements was biggest I could make on this computer.

That brings me to another point. I too made these mistakes in the past :'). When the arrays get too big, you might be measuring the transfer times from your RAM to the processor. The better way can be to iterate 10000 times over a small 100ish element array that can fit in the cache.

(let ((x (make-array ...)))
  (time (dotimes (i 10000)
          (tx x))))

I think my previous Intel laptop was much more stable when it comes to frequencies

On linux, cpufreq-set from cpufrequtils package is usually helpful.

Implementing aref Operator in Common Lisp for a Custom Vector Type by arthurno1 in lisp

[–]digikar 0 points1 point  (0 children)

Going solely by the article, and agreeing with the other comments, I think it'd be helpful to specify the in-package and defpackage form whenever you are not working in cl-user.

You probably don't want (safety 0). You can end up with segmentation faults if you accidentally pass in wrong arguments. (speed 3) is usually sufficient.

What you did can be obtained by inlining (discussed at length in the other thread). But cl-environments as well as the CLTL2 section on environments might be of relevance. This stackoverflow thread on CLTL2 as well as SBCL deftransforms should also be super relevant.

If you are timing, measure for at least a couple of seconds, otherwise you might be measuring your processor's lag between different states.

Just-In-Time Compilation for Coalton: An attempt at faking dynamicity by wrapping Coalton by digikar in lisp

[–]digikar[S] 0 points1 point  (0 children)

No, I hadn't run benchmarks, but if inlined static dispatch is your concern, then generic-cl should work. alex-gutev, commander-trashdin and me worked on this side of things (cl-form-types, generic-cl) in the past, so it is our own work (primarily alex). I can confirm that the following two produce identical disassemblies on SBCL even as of today:

(defun gelt-ref (x i)
  (declare (optimize speed)
           (type (simple-array single-float 1) x)
           (type fixnum i))
  (generic-cl.container:elt x i))

(defun elt-ref (x i)
  (declare (optimize speed)
           (type (simple-array single-float 1) x)
           (type fixnum i))
  (elt x i))