[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1747203800184851.png (339 KB, 1600x891)
339 KB PNG
萌えedition

>Lisp is a family of programming languages with a long history and a distinctive parenthesized prefix notation. There are many dialects of Lisp, including Common Lisp, Scheme, Clojure and Elisp.

>Emacs is an extensible, customizable, self-documenting free/libre text editor and computing environment, with a Lisp interpreter at its core.

>Emacs Resources
https://gnu.org/s/emacs
https://github.com/emacs-tw/awesome-emacs
https://github.com/systemcrafters/crafted-emacs

>Learning Emacs
C-h t (Interactive Tutorial)
https://emacs-config-generator.fly.dev
https://systemcrafters.net/emacs-from-scratch
http://xahlee.info/emacs
https://emacs.tv

>Browse imageboards in Emacs Org-Mode
https://github.com/eNotchy/4g

>Emacs Distros
https://github.com/caisah/emacs.dz

>Elisp
Docs: C-h f [function] C-h v [variable] C-h k [keybinding] C-h m [mode] M-x ielm [REPL]
https://gnu.org/s/emacs/manual/eintr.html
https://gnu.org/s/emacs/manual/elisp.html
https://github.com/emacs-tw/awesome-elisp

>Common Lisp
https://lispcookbook.github.io/cl-cookbook
https://cs.cmu.edu/~dst/LispBook
https://gigamonkeys.com/book
https://lisp-docs.github.io
https://awesome-cl.com

>Scheme
https://scheme.org
https://standards.scheme.org
https://go.scheme.org/awesome
https://research.scheme.org/lambda-papers

>Clojure
https://clojure.org
https://tryclojure.org
https://clojure-doc.org
https://clojure.land
https://www.clojure-toolbox.com
https://mooc.fi/courses/2014/clojure
https://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html

>Other
https://github.com/dundalek/awesome-lisp-languages

>Guix
https://guix.gnu.org
https://nonguix.org
https://systemcrafters.net/craft-your-system-with-guix
https://futurile.net/resources/guix
https://github.com/franzos/awesome-guix

>SICP/HtDP
https://web.mit.edu/6.001/6.037/sicp.pdf
https://htdp.org

>More Lisp Resources
https://lisp.nexus
https://rentry.org/lispresources

(call/cc >>108664729)
>>
File: 4chan_mascots.jpg (154 KB, 1024x768)
154 KB JPG
http://xahlee.org/xa/funny/4chan.html
>>
e m a c
m
a
c
>>
File: md.webm (173 KB, 738x800)
173 KB
173 KB WEBM
>>108708075
>I didn't know that markdown-toggle-markup-hiding exists, wish I had known about this earlier.

>>108720425
>might be worth making it toggle together with normal/insert state change in evil

(defun evil-enable-markdown-markup-hiding (&rest args)
"If the current major mode is markdown-mode, enable markup hiding."
(interactive)
(when (derived-mode-p 'markdown-mode)
(markdown-toggle-markup-hiding 1)))

(defun evil-disable-markdown-markup-hiding (&rest args)
"If the current major mode is markdown-mode, disable markup hiding."
(interactive)
(when (derived-mode-p 'markdown-mode)
(markdown-toggle-markup-hiding -1)))

(advice-add #'evil-normal-state :after #'evil-enable-markdown-markup-hiding)
(advice-add #'evil-insert-state :after #'evil-disable-markdown-markup-hiding)


This should work for markdown-mode and any of its derivatives like gfm-mode.
>>
>>108769018
noice
>>
>>108769018
I don't use evil, but this should work without having to advice a function:
(add-hook 'evil-insert-state-exit-hook #'evil-enable-markdown-markup-hiding)
>>
>>108769209
I guess I am a bit overly fond of advising functions. I just think it's a really cool ability. I suppose the polite way to go about things is to look for hooks first, and only use advice if hooks don't exist for the functionality I'm trying to augment.
>>
>https://emarsden.github.io/pg-el/about.html
Does anyone know of a way of seeing maps/polygons in emacs? I'd like to visualize postgis data using this;
>>
>>108769647
You might be able to find something in here. It's an OpenStreetMap viewer for Emacs.
https://github.com/minad/osm
>>
>>108769677
I think I'd need to set up a geoserver/tileserver for that. You know in pgadmin or dbeaver when you hover over a geometry result it shows it in a little box? I was planning on doing that.
>>
>>108768928
l i p s
i
p
s
>>
Does anyone know if sly and slime can coexist? I naively thought they could, but my initial attempts at having both in one config have not worked. I normally use sly, but I wanted to try slime out, because it looked like it had support for Coalton.

This is the config I tried.
(use-package slime
:ensure t
:config
(slime-setup
'(slime-fancy
;; slime-company ; I don't think I need this, because I have corfu instead.
slime-coalton))
(setq lisp-lambda-list-keyword-parameter-alignment t
lisp-lambda-list-keyword-alignment t
lisp-align-keywords-in-calls t)
(put 'make-instance 'common-lisp-indent-function 1)
(setq slime-lisp-implementations
'((sbcl ("/usr/bin/sbcl") :coding-system utf-8-unix)))
(add-to-list 'auto-mode-alist '("\\.ct$" . lisp-mode)))

Derived from: https://coalton-lang.github.io/manual/topics/introduction/#setting-up-emacs-with-slime
>>
first for Clojure.
>he doesn't have namespaced keywords
>>
File: 1728297184272.jpg (117 KB, 970x824)
117 KB JPG
>>108770926
>if sly and slime can coexist?
Usecase for "coexistence"?
>>
>>108770954
>namespaced keywords
use-case?
>>
>>108772428
Two entities with idor name in the same map. Some queries can also return namespaces. Datomic IDs are namespaced, next.jdbc can namespace the column name with the table name.
Convenient for avoiding name collisions
>>
>>108765907
I think you'd need to change/advice eww-retrieve-command, but it seems doable.
>>
>>108769677
>https://github.com/minad/osm
interesting
>>
https://clojure.org/news/2026/05/05/deref
>>
>>108767473
Moe theme makes me cum
>>
>>108772251
I just wanted to see what I was missing from slime-coalton and swank-coalton.
>>
>>108769018
alternative setup with hooks instead of advice
(add-hook 'evil-normal-state-entry-hook #'evil-enable-markdown-markup-hiding)
(add-hook 'evil-insert-state-entry-hook #'evil-disable-markdown-markup-hiding)
>>
maybe I like Janet because she's small
>>
>>108776018
it's fine. i like ef-themes more when it comes to colourful themes
>>
Emacs Chat 22: Shae Erisson
https://www.youtube.com/watch?v=Ovya0O2otbU
https://www.scannedinavian.com/
>>
>>108767473
LISP is clearly failed BASIC of it's own era.
There's literally nothing written in LISP except Emacs related crap and old AutoCAD scripts.
Dead language.
Not related to modern day hardware.
Visual Basic was a nice attempt to resurrect old language, friendly for newcomers.
This is very pathetic bite thread.
You need Qt-LISP bindings and Visual, non-Emacs crap editor so actual software can be written in the dead LISP.

Hello, my name is fag and I write in LISP.
/thread
>>
>>108773284
Maybe advice around eww-render would work too since you could modify things before rendering.
>>
>>108777691
Good morning sir
>>
I'm used to python sqlalchemy and using "models" as a pattern for webshit and databases. What do you use in clojure?
>>
>>108778295
I like rawdogging SQL.
https://github.com/krisajenkins/yesql
>>
File: 1778207653907337.jpg (98 KB, 802x1200)
98 KB JPG
Are changes to emacs always documented in /etc/NEWS when they are committed? Or only when the major/minor version changes?
>>
>>108778295
HoneySQL with custom SCI bin for running migrations.
>>
>>108779736
>Are changes to emacs always documented in /etc/NEWS when they are committed?
usually yes, but sometimes they are documented in a different commit. and when there's a new version release, /etc/NEWS gets moved to /etc/NEWS.[version number] on the master branch

https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=edd345c33ffabdc5df12601305a8817566134b25
>>
>>108777691
>LISP is clearly failed BASIC of it's own era.
>There's literally nothing written in LISP except Emacs related crap and old AutoCAD scripts.
>Dead language.
>Not related to modern day hardware.
>Visual Basic was a nice attempt to resurrect old language, friendly for newcomers.
>This is very pathetic bite thread.
Hi retard, you should improve your writing, in particular your grammar. Perhaps you could use Grammarly... which is written in Lisp.

>You need Qt-LISP bindings
You mean like this one, which supports hot QML reload?
https://gitlab.com/eql/lqml
>>
>>108780045
there is zero point to arguing with people that string together random technological terms in an act of appearing intelligent on an anonymous basket weaving forum.
just hide their posts. it is very important that we do not allow stupid fucking shit to go on in the Lisp thread, the only thread on this godforsaken board that is actually decent.
>>
File: npms6anatmzg1.jpg (108 KB, 1179x1383)
108 KB JPG
>>108780042
thanks my lisppa
>>
>>108778609
project with multiple people, too complex, varying levels of skill. No way we will do that.
>>108779984
what is an 'SCI'? Search engines are fucked.
>>
>>108781247
he probably means https://github.com/babashka/sci

The most Clojure-y approach to databases is to not use sql at all and instead use Datalog databases like Datomic, XTDBv1, Datalevin, Datahike and Datascript.
I've only used Datalevin out of these, which was fine for my purposes, but it was just a small solo hobby project.
>>
>>108781718
I have to use postgis and postgres by contractual demand.
>>
Emacs shell-mode can find some stuff after I add it to 'exec-path (software installed with pip). But M-! (shell-command) doesn't. My terminal can find it. What do I do?
>>
>>108782617
Check your $PATH in your terminal and compare with (getenv "PATH")
There's like 3 ways to lookup binaries in emacs and all get lookup paths from elsewhere. It's always such a pain in the ass to figure out which ones I forgot to update
>>
>>108782617
for shell mode, exec-path is only relevant for completion and not for actually looking for executables, that's the shell's job. i'm guessing M-! can't find the new stuff because it launches a subshell that inherits the environment of the shell where emacs was launched
>>
>>108782617
Do `M-! echo $PATH` and see if the PATH is what you expect or not.

This might be able to fix it.
https://emacs.stackexchange.com/a/10572/37580
>>
File: erik-naggum.lisp.jpg (222 KB, 1230x1485)
222 KB JPG
I was surprised to find this still online (17 years after his passing).
https://naggum.no/
http://xahlee.info/Netiquette_dir/death_of_a_troll.html
>>
>>108782543
you could try using sqlalchemy via libpython-clj
>>
>>108781247
Smart enough for Clojure but not SQL?
Well, if you really must have ORM-like features in your DB layer, you can try this.
https://github.com/camsaul/toucan2
I haven't used it myself, but it seems like you're looking for something like this where you can define "models" and have a library do the repetitive parts of SQL for you.
;; lang: clojure
(t2/table-name :model/people)
;; => :people

;; Select one row from :people with the primary key 1
(t2/select-one :model/people 1)
;; =>
{:id 1
:name "Cam"
:created-at #object[java.time.OffsetDateTime 0x2c8ec7ed "2020-04-21T23:56Z"]}
>>
>>108781247
you use SCI to provide a Postgres transaction in your bindings, alongside whatever other useful HoneySQL constructs you want for DRY SQL migrations (how many times do you really want to write out the HoneySQL equivalent of `id uuid primary key default gen_random_uuid()`?
>>
>>108784157
I was thinking of something like the javasir "repository pattern". Namespace for each domain object, with associated fns..
>>
>>108785391
(defn topo-sort
[gr]
(loop [res [] ;; resultado
nodes gr ;; estado atual do grafo
]
(let [ready (all-isolated-nodes nodes)] ;; nós isolados agora
(if (empty? ready)
(if (empty? nodes)
res ;; não tenho mais nada
;; Tenho nís isolados mas o grafo já foi percorrido
(throw (Exception. "Ciclo detectado ou dependência não encontrada")))
;; nós isolados e ainda tenho grafo a percorrer
(let [current-node (first ready)
current-node-id (:id current-node)
updated-graph (->> nodes
(remove #(= (:id %) current-node-id))
(map (fn [node] (update node :depends-on disj current-node-id)
)))]
(recur (conj res current-node)
updated-graph))))))

Is this decent clojure? I'm a schemer. Topological sorting my migration files.

;; dummy migrations.edn
[
{:id 0
:file "migrations/00_init.sql"
:description "Create migrations tracking table"}

{:id 1
:file "migrations/01_network_topology.sql"
:description "Create network_topology schema"
:depends-on #{0}}

{:id 2
:file "migrations/02_node.sql"
:description "Create and populate tables related to network nodes"
:depends-on #{0 1}}

{:id 3
:file "migrations/03_link.sql"
:description "Create and populate tables related to network links (edges)"
:depends-on #{0 1 2}}

{:id 4
:file "migrations/04_subnet.sql"
:description "Create and populate tables related to subnets and VLANs"
:depends-on #{0 2 3}}
]
>>
>>108786316
>yes I do enjoy speaking Spanish with a hot potato inside my mouth, how could you tell
>>
>>108779736
'(cute titties)
>>
>>108786332
500 NuCredits have been deduced from your Nuccount.
>>
>>108786316
your
(let
[current-node (first ready)
current-node-id (:id current-node)])

could be
(let
[[{current-node-id :id
:as current-node}]
ready])

with destructuring
>>
>>108786316
also, you could just do a `(sort some-vector-of-tuples-where-the-id-comes-first)`, because `sort` defaults to the sort order of the first element in vectors (which would be the integer ID).
>>
perfect use case for macros: automatic error message generation and catching by using the predicate form as the message. also, any local variables located in the predicate form can be provided in the error map too. the following code is just a mocked out test of a fake make-user function.
(defn
make-user
[username password password-again]
(c.REDACTED.s-verification/verify
::make-user
(string? username))
(let
[username-length
(count username)]
(c.REDACTED.s-verification/verify
::make-user
(>= username-length 4)
(<= username-length 32)))
(c.REDACTED.s-verification/verify
::make-user
(string? password))
(let
[password-length
(count password)]
(c.REDACTED.s-verification/verify
::make-user
(>= password-length 12)
(<= password-length 1024)))
(c.REDACTED.s-verification/verify
::make-user
(= password password-again)))

(c.test/deftest
test-make-user-with-nil-username
(c.REDACTED.t-helpers/is-thrown-verification-failure
#(make-user nil nil nil)
::make-user
'(string? username)
{'username nil}))

(c.test/deftest
test-make-user-with-empty-username
(c.REDACTED.t-helpers/is-thrown-verification-failure
#(make-user "" nil nil)
::make-user
'(>= username-length 4)
{'username-length 0}))
>>
>>108786942
also, >>108772428 asked about the purpose of namespaced keywords, and you can clearly see them being used to identify the failing operation in my error handling system
>>
>>108786837
dependencies are not necessarily 1,2,3,4,..., the ID is just a unique identifier. I've provided a dummy example in my original post.
>>108786818
thanks, clojure seems to have a lot of those facilities.
>>
>>108787221
I know we need to use recur for recursion, but is it performant? In scheme it is natural, but I am not very familiar with java, jvm and clojure.
>>
>>108787231
`recur` is not general recusion (which is accomplished by simply calling yourself), but tail-call recursion (kind of, not really, see the "trampoline" concept for more info). it is literally just another way of writing a loop, and is absolutely no different in performance from a normal loop.
>>
>>108776018
Is it available somehow for Kate?
t. Kate user
>>
>>108787231
>recur for recursion, but is it performant?
it's reasonably fast, it gets compiled down to an iterative loop.

If you need to do speed optimization on clojure code, here's some good reading:
https://hackernoon.com/faster-clojure-reduce-57a104448ea4

https://blog.redplanetlabs.com/2020/09/02/clojure-faster/

(this one's a bit fanboyish but still has good tips)
https://bsless.github.io/fast-and-elegant-clojure/

generally you want to identify places in your code that are worth optimizing using profilers, because writing fast clojure is possible but verbose and tedious.
https://clojure-goes-fast.com/kb/profiling/clj-async-profiler/

It's also worth checking out alternative libraries if somethibg in those libs is a bottleneck. If you're doing webshit and need to parse a lot of json, Chris Nuernberger's charred and Metosin's Jsonista are something like 20x faster than clojure.data.json.
Malli coercers are usually much faster at data transformations than manually looping through data structures.
>>
>>108787510
I'm familiar with TCO, it is a regular occurrence in scheme.
>>108787918
>json
sadly yes.
thanks
>>
>>108787531
use case for not using GNU Emacs, one component of the GNU/Linux operating system?
>>
>>108787531
you could port it
>>
PSA: You can use imenu to jump to use-package declarations if you have this in your early-init.el. (It has to be set *BEFORE* use-package is loaded.)
(setq use-package-enable-imenu-support t)
>>
>>108789882
>It has to be set *BEFORE* use-package is loaded.
why can't setopt automagically deal with that?
>>
>>108791065
because you haven't written the implementation for that
>>
>>108770954
>>he doesn't have namespaced keywords
The point of keywords in CL is that they globally belong to the same package. Otherwise they offer nothing over symbols.
>>
What are some cool things you made with Lisp? I've never used it before but it looks interesting.
>>
>>108792170
I make webshit in Clojure



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.