I really need to use the type system more. The gain in speed can be impressive, the SBCL's dev are beasts!
@pallandobaggins81722 жыл бұрын
I'm learning lisp at the moment and you have a gift for sharing information in a very consise way. No time is waisted watching your videos. Thank you for this! Quick question: how did you setup your snippets in emacs? Are you planning to make a video about that?
@GavinFreeborn2 жыл бұрын
For snippets I use tempel it's a package created by minad. Most people use yasnippets though
@pallandobaggins81722 жыл бұрын
@@GavinFreeborn Thanks, I will look into it 🙂
@h0stI13 Жыл бұрын
There are so few tutorials on declaim. Apart from this video and a small section in Lisp Cookbook I couldn't find anything else. The HyperSpec is like a cryptical bnf grammar that takes ages to reverse engineer to extract meaningful information from it. If common lisp had better documentation it would have a larger user base.
@MarkusKollmar Жыл бұрын
Great topic with good overview in Common Lisp. Because as you mentioned type safety currently has more interest, since languages like the popular Rust focus on this topic. For me who likes Common Lisp it feels good to further learn and use this language. Despite of the age, Common Lisp shows that it has powerful and elegant built in concepts and solutions which needs no reinvention of the language. However a small "disadvantage" may be that someone has to check his Common Lisp implementation for the exact supported details. If one needs/wants to support different implementations (or use advantages of a specific implementation) he could use read-time conditionalization. That means the using of #+ or #- followed by the implementation name, which is in the '*FEATURES*' variable. For example in case of SBCL you can use a implementation specific feature after #+sbcl to make your code more portable.
@freyrnjordrson14182 жыл бұрын
I'll add on why CL's type system is not as good as SML/OCaml/Haskell/Rust one. You indeed can define sophisticated types in CL, you do even have type constructors like (vector *) where * can be any type. What CL is lacking from Handley-Milner-related type systems are type variables, and the ability to express the relation between type variables in different type constructors. For example in OCaml I could write let reduce (f : ('a -> 'a -> 'a)) (l : 'a list) : 'a = 'a variable here stands for any type, but type of list elements should be the same as elements function f operates with. In CL such relation is inexpressible afaik, but maybe I'm wrong?
@0nus110 ай бұрын
Very helpful. Like so much of Common Lisp, it's difficult to find useful documentation for declaim.
@davidasher8100 Жыл бұрын
That was quite impressive! The combination datatype with predicate does work when you initialize a variable with a literal known at compile time. But what happens when you read `seconds` from a file or get it over the network? Is the predicate then checked at runtime?
@Crybyte2 жыл бұрын
Would be interesting to hear your thoughts on Carp, "a statically typed lisp, without a GC, for real-time applications"
@defnlife1683 Жыл бұрын
Hey Gavin, any good learning paths for full zero to hero on CL, Guile or Clojure? I've been making small programs in EL, Fennel and Hy but I want to ONLY use lisp lmao.
@टिरंजननकले2 жыл бұрын
How many keywords are there in Common Lisp? Just wondering. This is very complex to remember and do it.
@GavinFreeborn2 жыл бұрын
If you take a look at sly it will help. In my opinion these are probably the most confusing of them all. You usually only remember a few of these and utilize sly/slime to help you remember the rest.
@acebulf2 жыл бұрын
About 900, but most of them are very seldom used. In regular use, probably like 100.
@notoriouslycuriouswombat2 жыл бұрын
appreciated! great video! whats the best way for someone to get emacs setup to get those nice hints etc
@GavinFreeborn2 жыл бұрын
If you are using sly with emacs you should be able to reproduce most of this right out of the box.
@irmgardbaty288 Жыл бұрын
Is it possible to use this on a defmethod?
@laughingvampire75552 жыл бұрын
it is far more complicated, there is a difference between a programming language being typed and having a type system, C is typed but has no type system. Haskell is typed with a type system. A type system is a specification system that allows you to manage expectations about your code related to data traits/properties/features across all the code of your program, the pre-determined aspect is confused, some people think you have to make a single decision at a single point in time and just hope it is the right one and thus it is ridiculous because "specifications change" when is the opposite, the types help you to identify where the changes in specification will affect the code that was made with the old version of the specification. Now there is this traditional definition of static vs dynamic types but we can add dynamic type system with a checker to lisp a la Agda and this goes hand in hand with the concept of Meta Object Protocol.
@GavinFreeborn2 жыл бұрын
While I like the idea of this a cursory google search will show that the definition of a type system also applies to C en.wikipedia.org/wiki/Type_system . I do agree that a type system should outline expectations and as code changes assumptions change.
@laughingvampire7555 Жыл бұрын
@@GavinFreeborn just because wikipedia says it, doesn't make true.