Lisp Community

683 readers
1 users here now

A community for the Lisp family of programming languages.

Lisp (historically LISP) is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation. Originally specified in 1958, Lisp is the second-oldest high-level programming language. Only Fortran is older, by one year.

History

Associations and meetings

Resources - TODO

Related communities (dialects) - TODO

founded 5 years ago
MODERATORS
1
2
3
4
 
 

Pre-Scheme being a bootstrapping compiler for Schemes and an alternative to implementation in C.

5
6
 
 

Here comes a new Friday social topic!

  1. What was the first computer you ever worked/played on?
  2. What was the first editor you used to write computer programs?
  3. What programming language did you write your first program in?
  4. How many days/months/years after you wrote your first program did you learn Lisp?
  5. What was your first Lisp?
  6. Which editor/IDE do you work with the most today?
  7. What programming languages do you work with the most today?
  8. Which Lisp do you work with the most today?
7
8
 
 

Just wanted to share some (exciting) news about my Common Lisp project, euler-cl. I finally got the time to sit down and integrate it with Codecov! This means a couple of cool things:

  • 📈 Test Coverage Tracking: I can now see how well my code is tested over time, giving valuable insights into code quality.
  • 🏅 Codecov Badge: euler-cl now sports a snazzy Codecov badge to show off!
  • 📦 Reusable Setup: The code and setup process should be simple enough to be used as a reference to integrate Codecov (and potentially other services) into your own Common Lisp projects!

If you're interested this commit is almost all you need: https://github.com/bahmanm/euler-cl/commit/855b014

Let me know in the comments if you have any questions or want to chat about integrating Codecov into your own projects!

9
10
 
 

Hello! This is another Friday Social topic. Hoping that this will be more insightful than the previous ones and we will learn something useful from this.

What useful open source projects are written in Common Lisp? To keep it interesting, try and avoid posting links to your own projects because that could turn into a thread of self-promoters. Instead share open source projects developed by others that you have come across. Here goes the questions:

  1. Name one project (that is not already mentioned by others in this thread) that is written in Common Lisp.

  2. Which OSI-approved license is the project released under?

  3. Are you the author of this project? (I recommend that the answer to this be "No").

  4. Who is/are the author(s) or team(s) behind this project?

  5. Why is this project useful?

  6. What in your opinion is the best thing about this project?

  7. If you could recommend only one improvement that should be made in this project, what would it be?

Restricting this topic to "Common Lisp" so that we do not end up with a large list of Emacs packages. We will do similar thread for other Lisps in future. The project must be open source.

11
 
 

Friday Social is back! So we know we are all Lisp programmers here and we love the language and use it.

But I am sure some of us work with other languages too. Like I have to work with C, C++, Python and a number of other languages to work on different projects. I am sure some of you do too.

So the questions for this Friday Social are:

  1. What Lisp programming languages do you use?
  2. What non-Lisp programming languages do you use?
  3. What is your favorite Lisp programming language? Why?
  4. What is your favorite non-Lisp programming language? Why?
  5. What is that one thing about your favorite non-Lisp language that you wish to see in your favorite Lisp language?

Happy Friday!

12
13
6
submitted 7 months ago* (last edited 7 months ago) by aldalire@lemmy.dbzer0.com to c/lisp@lemmy.ml
 
 

Hello!

I've been obsessing about the lisp language recently. I've been in the periphery with learning about Haskell and functional programming. I have actually kind of avoided learning lisp because of its "ugly" syntax at face-value, despite being raised by Emacs as my first (true) editor. I woke up one day and decided enough was enough, i'm gonna learn lisp and gain a deeper understanding of Emacs and also programming. And dear god was it so worth it.

Just today I coded this function for Eratosthenes' sieve, and I had so much fun coding it! I like to go through Project Euler's archived problems when starting off with a new language because it really forces me to interact with the code rather than passively reading a programming book (I'm reading Land of Lisp, it's so unhinged I love it)

(defun range (start end)
  (if (< start end)
      (cons start (range (1+ start) end))))

;; Checks if d is a factor of n
(defun factorofp (d n)
  (zerop (rem n d)))

;; Sieve in lisp??
(defun sieve (n)
  (let ((primes (range 2 n))
        (curprime 2))
    (maplist (lambda (tail)
               (delete-if (lambda (n)
                            (factorofp curprime n))
                          (cdr tail))
               (setf curprime (cadr tail)))
             primes)
    primes))


CL-USER> (sieve 1000)
(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103
 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199
 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313
 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433
 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563
 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673
 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811
 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941
 947 953 967 971 977 983 991 997)

I love lisp because it is at its core a functional programming language, but (as i do in my sieve function with the outermost lambda) i can specify localized points where I define, use, and mutate state. It gives me the best of both worlds, functional and imperative.

Lisp has made me kinda like coding again. Every function feels like writing poetry, especially with the indentations. People say our parentheses are ugly but they're wrong and they're the ugly ones.

14
 
 

New web scraping framework from Alexander Artemenko/svetlyak40wt. Meant to be a CL alternative to Scrapy. Considering we have the great lquery and plump libraries in Common Lisp, building up to a fully featured alternative shouldn't be all that surprising.

15
16
 
 

How did they implement allocate a new cons cell?

17
 
 

Mito docs are pretty scarce, here's a helpful tutorial for getting a nice cruddy CRUD going.

18
 
 

"We create a search form, display products with ready-to-use HTML templates, organize our Djula templates with inheritance. Common pitfalls. That's the basics every web developer should know!"

https://www.youtube.com/watch?v=EFRVHmOCE7Q

By Vindarel, of CL cookbook fame.

19
 
 

There are many things to like about Common Lisp packages. In everyday programming, I really like being able to define one or more packages in one file then just have a (in-package package-name) at the top of other files opposed to having sometimes hundreds of lines of imports. Some programming languages are worse than others, but no other programming language that I know of allows one to keep imports in a totally different file.

The real point of this post is to talk about a specific scenario that reveals in interesting interaction between asdf systems (libraries), symbols, and macros. A conversation about packages almost always involves talking about symbols. Here is the situation: there is a library, A, that implements some very useful computations. The public interface for the library is a combination of macros and functions. It is rather verbose though, so you want to wrap it in a macro and create a new library: B. You want the users of your library to only have to use your library and not have to worry about depending directly on library A, so you want to re-export some of the symbols from library A so the users of your library can just use those symbols exported from your library.

If you don't see a problem with this then congratulations: you are sane. This relies on just a couple features:

  • feature of asdf: orthogonal to packages meaning that one can use a symbol from any package without having to explicitly load the system. If a package is loaded, it's symbols can be used.

  • feature of packages: symbols in a package can be referred to by their full name (package-name:symbol-name) anywhere in anyone's program. It does not matter if they have the symbol imported into their package. It does not matter if they have a package local nickname. It does not matter that they have a different symbol interned with the same symbol-name.

  • macros do not have any feature of their own that make this possible, but because of the previously mentioned features, using a symbol from another library in a macro expansion works just fine. As an added benefit, you cannot expand to symbol from a package that is not exported or from a non-existent package because the reader (which happens before macro expansion, even before macro definition) makes sure all the symbols are accounted for.

I witnessed someone in almost this exact situation. They were using Rust. The problem happened when someone tried to use the macro from library A that had been re-exported from library B. The macro expanded to use some symbols that were qualified assuming that the user had already imported them from library A. However, the user imported from library B. The work around ended up being to not re-export and just tell the user via documentation that they have to explicitly depend on library A, and use their macro.

That is the story. Let me know what you think, and tell me about a time that you were grateful for the way Common Lisp handles packages and symbols.

20
21
13
Common Lisp tips (github.com)
submitted 10 months ago by amoroso@lemmy.ml to c/lisp@lemmy.ml
22
 
 

This is another Friday social topic. You are aimlessly wandering around a beautiful hilltop by a sea when an angel approaches you from the opposite direction. She is no ordinary angel. She is a Lisp angel! She will grant one Lisp wish to you. Before she can fulfill your wish, she needs this information from you:

  1. Your favorite Lisp dialect.
  2. Your favorite non-Lisp programming language.
  3. Your favorite standard library function/macro/feature from your favorite Lisp dialect that you want to see in your favorite non-Lisp programming language.

Once you tell these 3 things to the angel, she will magically add your chosen feature to your chosen non-Lisp programming language.

What are your answers going to be?

23
 
 

The advantages of using Common Lisp are numerous:

  1. The shape of tensors is not limited to numbers, but can also include symbols and even S-expressions!
  2. Automatic Generation of Iterators, ShapeError, etc.
  3. Works as a Domain Specific Language for Deep Learning embedded in Common Lisp
24
 
 

Added a couple desktop backgrounds to the revisited #commonlisp logo in https://gitlab.com/santiagopim/common-lisp-logo

Happy hacking !!

25
 
 

Another bit of gold from ICFP 2023 by Pjotr Prins of the University of Tennessee.

The actual title of the talk is "Why code in Python+C if you can code in Lisp+Zig?" but the "Lisp" in this case is actually Guile Scheme. I didn't know this, but Zig uses the C ABI so it binds to any language that can do FFI bindings to C, including most Scheme and Common Lisp implementations. But why don't I just post the abstract here:

"Most bioinformatics software today is written in Python and for performance C is used. Lisp has been around for over half a century and here I don’t have to tell how or why programming Lisp is great. I will talk about Zig as a minimalistic new language that is unapologetically focused on performance, tellingly with a blazingly fast compiler. It is advertised as a replacement for Thompson, Ritchie, and Kernighan’s C, but it may even replace C++ in places. Zig uses the C-ABI and does not do garbage collection, so it is ideal for binding against other languages. In this talk I will present combining GNU Guile Lisp with Zig. I’ll argue that everyone needs two languages: one for quick coding and one for performance. With Guile and Zig you get both at the same time and you won’t have to fight the Rust borrow checker either."

view more: next ›