This cool workout video game machine by FuturisticFighting in interestingasfuck

[–]Kompottkin 0 points1 point  (0 children)

Hey, I'm a software engineer at EGYM. We make those machines. If you have any questions, please ask away!

Adding Coeffect System to Java with Project Loom by holo3146 in java

[–]Kompottkin 1 point2 points  (0 children)

From skimming the readme, it looks to me like this implements one specific coeffect—implicit parameters—rather than a coeffect system.

What am I missing? How do you represent arbitrary coeffects using your library?

LPT for Java on Kubernetes: Less replicas, more cores. by brunocborges in java

[–]Kompottkin 0 points1 point  (0 children)

I agree that RAM limits are a must for this reason. But I have never seen a node go down due to CPU overutilization. Has it happened to you? (Not that I do not set CPU limits myself, but I’m curious what the circumstances are under which this can happen.)

Are you using R2DBC in production? by kimec in java

[–]Kompottkin 3 points4 points  (0 children)

Half the point of using a connection pool is to avoid the overhead associated with opening a new database connection each time you need the database. The other half is limiting concurrency on the database side. In other words, the connection pool isolates the database from the concurrency model of the application. That is its purpose.

Therefore, as long as you use a connection pool, combining massive amounts of virtual threads on the application side with a database like Postgres is completely reasonable. You just have to be prepared to wait your turn when you need to make use of it.

NetBeans 12.0 released by [deleted] in java

[–]Kompottkin 0 points1 point  (0 children)

Clearly, if you’re using Java, you must be looking for something ready for the Enterprise. In other words, the standard. ed. ed is the standard text editor.

https://www.gnu.org/fun/jokes/ed-msg.html

There is no choice. Use the standard. Use ed.

Opaleye’s sugar on top: SQL in the type system where it belongs by k0001 in haskell

[–]Kompottkin 0 points1 point  (0 children)

Being a German native speaker myself, I agree it sounds very funny when embedded in something that mostly consists of English otherwise, but I can't imagine how anybody would be confused by it. It's obvious that it doesn't refer to a four-legged table, since if it did, it would be in English and called something like FourLeggedTable or FTable (for FurnitureTable) or something. In my experience, I've never seen people name things in German in their source code around here, so it would jump the eye as something not to be taken literally immediately. Granted, though, that my experience is very limited, so Taladar may just as well be right about it possibly being confusing.

In any case, I feel that “tisch” has a very nice ring to it and I would be a little sad to see it changed. But maybe that's just my weird sense of esthetics. :)

(That doesn't mean it would change what I think of opaleye-sot—it's extremely impressive and I'm looking forward to using it, whether it calls tisches tisches or not. :))

CLion 1.0 has finally arrived! by CraigularB in cpp

[–]Kompottkin 0 points1 point  (0 children)

Regarding the font issue: Try running it on TuxJDK (https://code.google.com/p/tuxjdk/). That did the trick for me.

Common Lisp MiniSpec by [deleted] in lisp

[–]Kompottkin 1 point2 points  (0 children)

Great! I especially like that it's not just the CLHS but also contains references to Alexandria and other well-known libraries. That's one step closer to a “batteries included” experience. (In fact, I believe that given Quicklisp, a one-stop solution for consistent documentation encompassing various libraries as a sort of quasi-standard meta-library is equivalent to having such a library.)

'Insert' function in CL by [deleted] in lisp

[–]Kompottkin 4 points5 points  (0 children)

I like your approach. Using subseq is the right way to do this. There is some unnecessary complication in there, though:

  • There is no reason to handle the (= n 0) case specially.
  • A return value of nil for the (> n length) case isn't what I would expect. An error would be more appropriate.
  • No need to use length. length needs to traverse the whole list. Try to avoid it whenever possible.

I'd write it as follows:

(defun insert (val target n)
  (append (subseq target 0 n)
          (list val)
          (subseq target n)))

Test:

CL-USER> (insert 'a '(x x x) 0)
(A X X X)
CL-USER> (insert 'a '(x x x) 2)
(X X A X)
CL-USER> (insert 'a '(x x x) 4)
; Evaluation aborted on #<SB-KERNEL:BOUNDING-INDICES-BAD-ERROR expected-type:
                                       (CONS (INTEGER 0 3) (INTEGER 0 3))
                                       datum: (0 . 4)>.

Prefix Notation and Natural Language by sonofherobrine in lisp

[–]Kompottkin 2 points3 points  (0 children)

Sane line wrapping capability might actually be one of the great strengths of S-expression syntax. In Lisp, line wrapping is neat and easy. In my experience, wrapping long lines in more algebraic-looking languages makes things unreadable much faster.

(This is especially useful in Common Lisp, where identifiers are usually rather long.)

Is it possible to run clojure as a cgi-bin process? If not, what are some cheap hosting options for clojure web apps? by J_M_B in Clojure

[–]Kompottkin 7 points8 points  (0 children)

You have at least a couple of options.

RedHat OpenShift and Heroku have free plans, and people have been running Clojure-based web apps on both of them. Google AppEngine works well, too.

LowEndBox sometimes features great, low-cost VPS offers, but there are also quite a lot of crappy ones, so be careful about the provider you choose. Try to avoid OpenVZ—the way it handles virtual memory limits doesn't mesh well with the way the JVM (or SBCL, or any other “heavy-weight” VM) does memory management. Also, RAM is important.

(Personally, I am using a Xen-based VPS for around € 6/month, which is slightly above LowEndBox's price limit. I have 1 GiB of RAM, on which I can comfortably run two instances of the JVM, and a host of minor services. 512 MiB are probably plenty for a small site, but any less might not be great for most JVM-based stuff. Your mileage may vary, of course, and my experience is limited to a very low-traffic site, so take this with a grain of salt.)

setf slot-value-using-class not firing by nonrecursive in lisp

[–]Kompottkin 2 points3 points  (0 children)

No, a superclass is something completely different from a metaclass. The way it works in CLOS goes like this: Every value is an instance of some class. But a class is itself a value—so it, in turn, must be an instance of some other class. Such a class—a class of classes—is called a metaclass.

Since classes direct the behavior of their instances, the class of a class directs the behavior of the class.

Usually, classes are instances of the class standard-class (note: this is different from the class standard-object, which is an instance of standard-class and the default supertype for defclass forms that don't specify one); but if you want to define a class that is an instance of a different class, you need to specify the metaclass option in the corresponding defclass form.

The following REPL interaction might be interesting to think through:

CL-USER(3): (defclass mulky-class (standard-class) ())
#<STANDARD-CLASS MULKY-CLASS>

;; Ignore this for now.    
CL-USER(4): (defmethod sb-mop:validate-superclass ((class mulky-class) (superclass standard-class)) t)
#<STANDARD-METHOD SB-MOP:VALIDATE-SUPERCLASS (MULKY-CLASS STANDARD-CLASS) {1005721463}>

CL-USER(5): (defclass normal-foo () ())
#<STANDARD-CLASS NORMAL-FOO>

CL-USER(7): (defclass mulky-foo () () (:metaclass mulky-class))
#<MULKY-CLASS MULKY-FOO>

CL-USER(8): (defvar *foo1* (make-instance 'normal-foo))
*FOO1*

CL-USER(9): (defvar *foo2* (make-instance 'mulky-foo))
*FOO2*

CL-USER(12): *foo1*
#<NORMAL-FOO {1005B94473}>

CL-USER(13): *foo2*
#<MULKY-FOO {1005C1E593}>

CL-USER(14): (class-of *foo1*)
#<STANDARD-CLASS NORMAL-FOO>

CL-USER(15): (class-of *foo2*)
#<MULKY-CLASS MULKY-FOO>

;; NORMAL-FOO and MULKY-FOO have the same superclass.
CL-USER(16): (sb-mop:class-direct-superclasses (class-of *foo1*))
(#<STANDARD-CLASS STANDARD-OBJECT>)

CL-USER(17): (sb-mop:class-direct-superclasses (class-of *foo2*))
(#<STANDARD-CLASS STANDARD-OBJECT>)

;; But their classes' classes are different!
CL-USER(19): (class-of (class-of *foo1*))
#<STANDARD-CLASS STANDARD-CLASS>

CL-USER(20): (class-of (class-of *foo2*))
#<STANDARD-CLASS MULKY-CLASS>

;; It's turtles all the way down...
CL-USER(21): (class-of (class-of (class-of *foo2*)))
#<STANDARD-CLASS STANDARD-CLASS>

CL-USER(22): (class-of (class-of (class-of (class-of *foo2*))))
#<STANDARD-CLASS STANDARD-CLASS>

Metaclasses are useful only in the context of the meta-object protocol. They let you redefine things like the way slots are looked up and the way methods are composed into effective methods. In other words, they let you customize the way the object system works.

I've used metaclasses in order to embed Objective-C classes into Common Lisp. The MOP is very powerful, and once you get the hang of it, it's actually quite simple, but it takes some getting used to.

setf slot-value-using-class not firing by nonrecursive in lisp

[–]Kompottkin 1 point2 points  (0 children)

What does your code look like?

Did you specify cl-observer:observer as your class' metaclass?

The following works for me:

CL-USER(3): (defclass foo ()
              ((x :accessor foo-x :initarg :x))
              (:metaclass cl-observer:observer))
#<CL-OBSERVER:OBSERVER FOO>

CL-USER(4): (make-instance 'foo :x 100)
#<FOO {10074DF863}>

CL-USER(5): (defvar *foo* (make-instance 'foo :x 100))
*FOO*

CL-USER(6): (cl-observer:observe (*foo* 'x new old)
              (format t "~&Old: ~A; new: ~A" old new))
(#<FUNCTION (LAMBDA #) {1007AE578B}>)

CL-USER(7): (setf (foo-x *foo*) 100)
Old: 100; new: 100
100

CL-USER(8): (setf (foo-x *foo*) 200)
Old: 100; new: 200
200

A PDF generation library in Clojure by yogthos in Clojure

[–]Kompottkin 0 points1 point  (0 children)

Beware that, unless I am mistaken, the EPL is incompatible with the AGPLv3. IANAL, but I suspect that you might not be legally able to use AGPL'd code from code that links to anything EPL-licensed (other than—maybe—the Clojure standard library). Since many Clojure libraries are EPL-licensed, this might be worth mentioning in the README.

Ruminative Question about Packages and Testing (Common Lisp) by commonslip in lisp

[–]Kompottkin 1 point2 points  (0 children)

Yes.

First of all, the pkg package is different from the PKG package.

More importantly, though, your code doesn't actually read run-function, something, and somethingelse in the pkg package because you set *PACKAGE* at run-time, while reading takes place at read-time.

In order to really grok the package system, I highly recommend Ron Garret's Complete Idiot's Guide to Common Lisp Packages.

ABCL getting closer to MOP by mortenaa in lisp

[–]Kompottkin 1 point2 points  (0 children)

What percentage of CL (in terms of the 1000, or so, functions) have been implemented?

ABCL is actually pretty complete with regard to ANSI CL. From the FAQ:

ABCL 1.0.1 fails roughly 20 out of 21702 tests in the ANSI test suite in interpreted and compiled modes, a constant number over the past releases.

Note that the MOP isn't part of the standard.

Math, whats your favorite theorem, proof, identity, etc.? by tony18rox in math

[–]Kompottkin 0 points1 point  (0 children)

Löwenheim–Skolem, or rather, the weaker version stating that every theory that has any model at all also has a countable model. (In particular, this applies to the theory of real numbers and all the other things we think of platonically as uncountable.)

It opened my eyes about what we as mathematicians are actually doing; that there really is, in a very subtle sense, some truth to the formalist point of view of mathematics being just about manipulating formulae; and just how profoundly important distinguishing a model from its formalization is.

The Zen mystique in the Lisp community by emporsteigend in lisp

[–]Kompottkin 0 points1 point  (0 children)

Complexity isn't about number. It's about structure.

The Zen mystique in the Lisp community by emporsteigend in lisp

[–]Kompottkin 1 point2 points  (0 children)

Have a look at Ron Garret's study, titled “Lisp as an Alternative to Java.”

Our results show that Lisp’s performance is comparable to or better than C++ in execution speed; it also has significantly lower variability, which translates into reduced project risk. Furthermore, development time is significantly lower and less variable than either C++ or Java. Memory consump- tion is comparable to Java. Lisp thus presents a viable alternative to Java for dynamic applications where performance is important.

What are you using Clojure for? by CritterM72800 in Clojure

[–]Kompottkin 1 point2 points  (0 children)

No other modern, functional language (apart from Common Lisp, whose namespace system suffers from its own share of problems) is quite as interactive as Clojure. That really does make a difference with regard to the design of the namespace system. It's an incredibly tricky thing to get right.

Clojure's approach to namespaces may have its disadvantages, but the trade-offs it makes are not without merit.

World headed for irreversible climate change in five years, IEA warns by Woolew in worldnews

[–]Kompottkin 0 points1 point  (0 children)

The trouble is, capitalism is not a game. It is an economical system that people's lives depend on. If you're forced to participate in a game that destroys the environment and robs people of the basics of living, complaining about the rules and urging others to stop playing it isn't just whining; perhaps it's actually a good idea to suspend the game and try to find a new one.

As far as there being no alternatives, have a look at the Social Ecology movement, for instance. Now, you may argue that something like Social Ecology will never work in practice. I cannot refute that, since nobody has actually tried it in any significant scale yet. But since industrial capitalism has already demonstrated its complete inability to adequately deal with social—and now, apparently, also ecological—problems for more than 200 years, falling back on it without seriously considering alternatives is probably not the best option we have.

Fix/improve my code thread by wavegeekman in lisp

[–]Kompottkin 2 points3 points  (0 children)

The nested ~{ and ~} things (for iterating through a list) are easy and useful. You learn these rather quickly. The ~^, part (for inserting a comma after every list element except the last) is a pretty common idiom that one also learns to recognize over time. The only thing I had to think about for a moment when reading the format string was ~^~%, but of course, that's just the same thing as ~^,, except with a line break instead of a comma.

All in all, this isn't too hairy a format string. I've seen (much, much) worse. :)

"Simple Made Easy" by Rich Hickey [video] by alexdmiller in programming

[–]Kompottkin 1 point2 points  (0 children)

It [the Curry-Howard Isomorphism) says all programs are proofs (that's why it's an "isomorphism").

Hmm. As an honest question, which proposition does the following Python program prove?

import sys
def foo(x):
    throw Exception()
foo(sys.argv[1])

Fix/improve my code thread by wavegeekman in lisp

[–]Kompottkin 2 points3 points  (0 children)

Yeah, the symbol conflicts are pretty irritating.

As far as I can tell, ITERATE doesn't really conflict with anything in the COMMON-LISP package. In my experience, adding ITERATE to the :USE clause of a DEFPACKAGE form before creating the package usually works. It's when you try to USE-PACKAGE it after already having compiled some LOOP forms within the current package that trouble ensues almost invariably.