[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: 1756808658547230.png (761 KB, 500x500)
761 KB PNG
save-lisp-and-die 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

(thread-last >>108655774)
>>
>>108664729
Now this is a good emacs logo
>>
>>108664729
WHO IS THIS FUCKING ARTIST I SEE THEM EVERYWHERE
>>
>>108655492
>Most of the things I want to do can already be done so I don't see a reason to write yet another package that does the same thing.
Emacs is shipped with a couple of packages that do the same thing...
>>
>>108664729
How do I set this image as my default Emacs startup screen
>>
>>108665600
(setq-default fancy-splash-image "emac-sexo.png")
>>
>>108665334
Asanagi, popular for doing a lot of ryona H-manga to varying degrees
>>
>>108664729
me on the right
>>
Do any Clojure dialects other than JVM and Babashka even make sense to use? The only situation I can think of where dealing with the additional tooling burden would be worth it would be when you've already written a bunch of Clojure code for your program's business logic that you want to re-use on a different platform, e.g. taking JVM back-end code and moving it to a CLJS/CLJD front-end.
>>
>>108666774
jank should be production ready in 15 years or so
>>
>>108666774
Clojurescript obviously delivers value by easily supporting web clients (literally everything, even smartwatches). A Clojurescript ability to call Rust-generated WASM would be cool, such as for a front end that delivers client-side password hashing using Argon2 implemented in WASM (beware, you must ensure you do several things exactly right in order to maintain security while doing this).

Btw Clojure is the best Lisp that we have available today, imho. Lisp is all about reducing code to data, which is easily done. It is done in like 7 rules ffs (or whatever it is). From there, all that matters are APIs, and Java/Javascript have a fuckload of them, and writing wrapper libs in Clojure (you do write microlibs as a general dev strategy, right?) is trivial, if even needed (dependent upon taste).
Performance is wonderful when optimized using type hints and such with mutable data structures (which you must do in Common Lisp anyway).
Reader macros are abhorrent taste and should never be used. Lists (should be considered function calls, but that is not entirely true, even in Clojure, which is SHAMEFUL and a CLEAR BENEFIT THAT WE COULD MAKE TO THE LISP SYNTAX AS A WHOLE), vectors (the true way to store contiguous data), maps, and sets (criminally underused by beginners) with symbols and keywords allow for representation of whatever constructs that you need, simple as, get good at organizing information mfer.
The JVM's introspection is quite good, in fact you can get type information about Java shit at runtime! Common Lisp's is undefeated in some categories, yes (except by Smalltalk), but is dependent on implementation and does not have the ability to serialize/resume callstack/green thread representations (such as in Smalltalk). the Erlang runtime also offers superior introspection capabilities, imo (in the ways that often matter to me, such as memory consumption determination for a specific process, easy given there is no shared memory).
>>
TIL that eshell conditionals have an else clause but do away with the else keyword.
https://www.gnu.org/software/emacs/manual/html_node/eshell/Control-Flow.html
#!/usr/bin/env -S emacs --batch -f eshell-batch-file
unless (file-exists-p "emac-sexo.png") {
wget --progress=dot https://i.4cdn.org/g/1776899781852514.png -O emac-sexo.png
} {
echo "already downloaded"
}
>>
>>108667995
I also figured out how to read variables from the Elisp side with eshell-get-variable, but this wasn't documented anywhere that I could find. I found it via `C-h f` autocompletion guessing.
#!/usr/bin/env -S emacs --batch -f eshell-batch-file
for i in 1 2 3 {
echo (eshell-get-variable "i")
}


I feel like there should be a $ macro for the Elisp side that expands to an eshell-get-variable expression.
>>
File: clojure-dart.jpg (440 KB, 1920x2160)
440 KB JPG
>>108666774
I haven't used this one myself, but it looks promising if you need to do mobile development.
https://github.com/tensegritics/ClojureDart

https://www.youtube.com/watch?v=ZLYnOTCRBbg
>>
>>108668201
I'll have to watch that... My impression of Dart has been that approximately no one uses it except some internal teams at Google, and it's an existence proof against the claim that bad langs like Go only get traction because of big corporate backing. Being useful outside of just Android sounds like a win though, I remember getting normal Clojure working well enough for some Android applications many years ago and there have been a few games pushed onto the app store using it.
Maybe Dart would be a more attractive target for Common Lisp instead of the handful of failures attempting a JavaScript target.
>>
>>108668231
>Dart has been that approximately no one uses it except some internal teams at Googl

https://itsallwidgets.com/
>>
>>108668042
>I feel like there should be a $ macro for the Elisp side that expands to an eshell-get-variable expression.
(defmacro $ (var)
"Shorthand for reading VAR using `eshell-get-variable'."
`(eshell-get-variable ,var))

Now I can say:
echo $LINES
echo ($ "LINES")


Is this a valid use-case for macros? I don't have a feel yet for when it's acceptable to write a macro or not.
>>
>>108668264
More than I thought, but still barely anything, not much open source, and so much duplication of existing things or apps that are better served as google searches...
>>
>>108664729
hello frens
does anyone else HATE the default emacs indentation? i was procrastinating for like half day at work to figuere out how to fix it :(
>>
>>108669080
>does anyone else HATE the default emacs indentation?
yes
>>
>>108669080
I decided to migrate to Emacs (used that in the past many years ago but did not program that much then) and the first thing what was a problem was the tab / ident.
I did something but not really sure if it still works or not.
I just want to tab = 4 spaces and that's that, I don't care about someone else's religious attitude towards identation.
Spent whole day yesterday configuring and testing stuff.
>>
>>108668201
wait can you use clojure for android dev? its a jvm language isnt it?
i am basically looking for anything that would make mobile dev fun for me but its all slop, its like a worse version of webdev
>>
>>108668841
almost 4000 apps in less than 8 years; that's more than one app published every day. and not every apps made with flutter are being listed here.
>>
>>108669118
exactly what i thought, not to mention, the formatting is terrible when you are dealing with strings.
it took me hours but tab-always-indent nil seems to do the job, along with disabling electric-indent, but now i dont get any indentation on new line but oh well
>>
>>108669158
Of course it's always a learning process. Takes a long time to know everything well enough.
This is what I did and it seems to work (I mostly dabble in C anyway)
;; make tabs behave 4 spaces everywhere no questions asked
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(defun my-insert-4-spaces ()
(interactive)
(insert " "))
(global-set-key (kbd "TAB") 'my-insert-4-spaces)
(global-set-key (kbd "<tab>") 'my-insert-4-spaces)

I'm using X and one other thing what is bothering me is the unreliability of copy/paste. I had tons of trouble in Vim and I actually ended up using xclip to manage copy/pasting between software.
>>
>>108668841
dart is very popular though, mainly for flutter, which is one of the few ways to do multi platform guis alongside javascript/electron

im honestly kind of disapointed lisp isnt as popular for frontend. its syntax is perfect for defining markup
>>
>>108668841
Flutter is literally the most-used framework for mobile apps, and has been for half a decade

>>108669119
>its a jvm language isnt it?
not exclusively, no.

>>108668201
the thing is, why use ClojureDart instead of just Dart?
You still need to learn enough Dart to at least understand the documentation for Flutter, plus CLJD's quirks vis-a-vis JVM Clojure, so you're not really saving time up-front. And this is assuming you're already an advanced Clojure programmer, as there's zeeo CLJD documentation aimed at Clojure beginners.

Then you lose much of the tooling support for Dart, like auto-complete and pop-up documentation and so on, not to mention LLM support.

Then you have to deal with the additional layer of build tooling CLJD introduces.

Clojure is a nicer language than Dart for sure, but I don't see the benefits outweighing the sacrifices at this point.
>>
>>108669124
It's not bad, but compare with Kotlin over a similar time period. Of course I'd love to point at a comparable number of Common Lisp applications even if half of them were on the level of https://github.com/SSebigo/ahhhhhh (listed on that site of Dart/Flutter apps)
>>108669186
The cycle of people picking up Thing for multi-platform apps and later realizing they should have just done separate apps will never end...
Xamarin was another popular tool for cross-platform development, using C#. Even though support has ended I bet the numbers would still dwarf the Dart ecosystem.
>>108669119
You can and I did but I wouldn't recommend it. Surely it's better now though, one of the worst problems back when I experimented was Clojure having a huge startup time.
>>
>>108669180
What trouble did you have in vim? "+y and "+p or set clipboard=unnamedplus to automatically use the system clipboard.
>>
>>108669119
2011... https://www.youtube.com/watch?v=1NptqU3bqZE
>>
>>108667995
You can use the else keyword in Emacs 31
https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=fada04cfc7

'if' and 'unless' simply get trabslated into an elisp if, so it makes sense why there wasn't originally an else keyword.

>>108668289
You could have used a function instead. Using a macro here doesn't change anything.
>>
>>108669380
Multi platform is the only sane way to do apps nowadays what are you on about?

There is no way in hell i am buying apple product and learning some bespoke shitstain apple language like objective c- i mean swift- i mean...

People give web dev shit, but in reality it is the only sane way to do ui in the current day, unless you roll up your own bespoke ui rendering which good luck doing that on any mobile platform
>>
>>108669397
I don't want to think about vim anymore. I always thought it was my go to editor but after I got more involved with programming hobby it became a burden.
>>
>>108669810
helix deprecated vim
>>
>>108669712
Across the spectrum of businesses, it's common for them to organize into either a unified team using React Native/Flutter/etc. or to organize into split platform teams, sometimes with a small shared infrastructure team. And it's common for a particular business to migrate from one to the other as they decide to make different tradeoffs. Perhaps somewhat paradoxically, splitting into platform teams can prevent or delay headcount explosion as it helps avoid premature splitting into feature teams.
Besides that there are still the technical tradeoffs and friction for entire categories of apps where not being truly native hurts.
>>
So, I have an internet friend who is doing clojure code reviews for the company he is working for. Everything else is unknown. I haven't pushed him.
Every time when I hear about clojure, I would read the word 'java' and it would be an instant turn off.
I wonder what sort of company is he working for?
Has to be a niche I think.
>>
>>108670629
>I wonder what sort of company is he working for?
about 50% chance it's something in finance
>>
>>108670629
Watch some Rich Hickey talks
>>
>>108671544
This is what I thought too. He's not my friend per se.
He was smug about it too.
I always thought finance and banks would use Fortran.
>>
>>108670629
Nubank.
>>
>>108672237
If I had a Clojure job I'd be smug too. Above average salaries, work in a language that's not dogshit even if it's not my top.
If it's not finance it's probably some data analysis firm.
Fortran is only used for legacy number crunching code, which is a small part of any project and is called into by any language just as well as any other. More suitable for science than finance. Jane Street uses OCaml for everything. Even FPGA design.
>>
Lisp mentioned!
https://youtube.com/watch?v=7fGB-hjc2Gc&t=1h9m10s
>>
I was reading a blog post by one of the Emacs maintainers and I was very surprised to see /g/ mentioned. Bros... are we popular?

https://sdf.org/~pkal/blog/emacs/setup5.html
>>
>>108672809
>one of the Emacs maintainers
one of the maintainers of Emacs' core packages*, my bad
>>
File: laugh-at-cpp.jpg (140 KB, 1920x1080)
140 KB JPG
>>108672760
I watched a few minutes of this out of curiosity. C++ sounds painful.

>>108672809
>I was very surprised to see /g/ mentioned.
You never know who's lurking.
>>
File: file.png (76 KB, 778x524)
76 KB PNG
A very useful browser extension:
https://github.com/kuanyui/copy-as-org-mode
>>
>>108669080
>default tab behavior
How does this even matter? Essentially every mode has its own tab setting. I can't remember the last time I used a tab in fundamental mode.
>>
>>108672956
>You never know who's lurking.
This is most likely a case of egosurfing tbhdesu.
>>
>>108669080
My solution to Emacs indentation problems hsa been to rely on editorconfig-mode which comes included with Emacs since 30.1. If there is a .editorconfig file at the root of a project, Emacs will honor it and indent code according to the rules defined in that file.
https://editorconfig.org/
https://www.gnu.org/software/emacs/manual/html_node/emacs/EditorConfig-support.html
>>
>>108669639
I noticed he was also adding the ability to chain multiple 'else if's too. This will make some future Eshell scripts require Emacs 31 or higher if they use that new feature. I've noticed that I tend to drop down to full Elisp when I need more control. I even have one Eshell script that's 100% Elisp.
>>
>>108665334
>>108666138
>Asanagi
https://gelbooru.com/index.php?page=post&s=view&id=885518&tags=asanagi+2girls+cat_ears
>>
>>108673518
>This will make some future Eshell scripts require Emacs 31 or higher
Future Eshell scripts will become even more backward incompatible if lexical scope support is added to Eshell, but I think it's the right direction. Eshell seems to need a lot of modernizing.
>>
>>108666138
>a lot of ryona H-manga
Based
>>
This is something I wrote for downloading a URL to a file using dexador.
(defvar *proxy* nil
"Optional HTTP Proxy")

(defun dl (url &key (dir "./"))
"Download url to dir.
dir defaults to './' and if specified, must end in '/'."
(let* ((uri (uri url))
(path (uri-path uri))
(filename (format nil "~a.~a"
(pathname-name path)
(pathname-type path)))
(destination (format nil "~a/~a" dir filename))
(res (dex:get url :proxy *proxy*)))
(ensure-directories-exist dir)
(with-open-file (stream destination
:direction :output
:element-type '(unsigned-byte 8)
:if-exists :supersede
:if-does-not-exist :create)
(write-sequence res stream))
url))

It mostly works, but it seems to flake out when I run it with high concurrency (via lparallel). I'm not sure why.
>>
>>108672543
>If I had a Clojure job I'd be smug too. Above average salaries, work in a language that's not dogshit even if it's not my top.
someone should tell my employer
i suspect that statistic is heavily skewed by nubank
>>
>>108677274
cubankkk (ass-bank) was told by the central bankkk of cuzil (asszil) to remove any mention of "bank" from their name (because they are not one).

After opening a office in Guzanopolis (florida) because the guzano CEO wanted to "work from office" they've ended remote work for a lot of people.

As for the name, it seems they bribed their way into being allowed to become a bank.
>>
File: jarpig.png (156 KB, 688x883)
156 KB PNG
>make a web interface
>use zero javascript
>still can't be used via eww because it turns out eww is completely incapable of rendering certain html tags, such as <dialog>
>>
>>108678719
Looks nice. What does it do, anon?

>>108672543
Team that interviewed me at a clojure job once was a bunch of smuggest arrogant cunts I've ever encountered on an interview. I don't think they event wanted to hire anyone, just practiced their interviewing skills because their HR told them so.
>>
File: mine kampfy editor.png (295 KB, 611x1102)
295 KB PNG
The Coalton guy just launched a newfag-friendly IDE for Common Lisp named mine.
>>
>>108680299
>mine
what a stupid name
>>
File: Jan2017ServalKaban.jpg (48 KB, 532x372)
48 KB JPG
>>108680830
I keep pronouncing it as mee-nay. The japs have ruined my brain.
>>
File: mine-banner800.png (339 KB, 800x267)
339 KB PNG
>>108680830
You don't want to be a Coalton miner?
>>108680960
>ruined
enhanced*
>>
>>108680830
Naming things is hard, please understand.
>>
File: screen.jpg (77 KB, 527x928)
77 KB JPG
>>108678804
>What does it do, anon?
I'm using it as an interface for ffmpeg to do stuff like file conversion, audio extraction, scaling and so on. But I guess in theory you could use it to run any kind of command on any kind of file
>>
>>108664729
Do Lisp users look like this?
>>
>>108664729
emacGODS are ryonachads?????
>>
File: file.png (766 KB, 3002x2032)
766 KB PNG
Been having a blast making factorio modding viable in fennel + a shitload of elisp for integration into emacs, including a help buffer for reading docs inside of emacs and consult/apropos for all of it's entities.

I've figured this usecase was ripe for macro shenanigans and I was right, most people that tried making fennel mods got caught into the trap of trying to use fennel as is without making any tooling first or intercepting the compiled code to make it fit into flua (castrated lua 5.2).

So far I've managed to implement type validation at compile time through macros, and I'm testing a couple different macroexpansion methods so that I can manipulate HOW the generated Lua is distributed through the mod structure. And it's working, I can create a prototype and prevent it from being compiled if validation doesn't go through.

This shit is actually one of the reasons I started seriously looking into making elisp packages/fennel. I can't believe I'm getting there, like 2 years in the making. Still highly dependent on my config though, need to clean A LOT of stuff before publishing.
>>
>>108681743
I use Lisp and I look like that, so yes
>>
File: mine craft.png (78 KB, 640x480)
78 KB PNG
>>
>>108682421
Minecraft in Elisp soon
https://www.youtube.com/watch?v=ckOpWQYpKjo
>>
>>108682421
But minecraft has been free for decades, why should I ever play a clone
>>
>>108682421
What is "mine"?
>>
any good claude integration plugins for emacs?
>>
>>108672956
its metaprogramming is seriously awful
you can't even debug templates
>>
>>108682924
gptel
agent-shell
eca-emacs
>>
>>108681743
Only on the inside
>>
>>108680299
Mine works pretty well, and I think it's a great way to get people acquainted with Common Lisp and Coalton. My only feature request would be to implement undo/redo in the text editor. If he wants extra credit, he could also add an object inspector.

If people want more, they can graduate to Emacs.
>>
>>108684629
Undo is on Ctrl-Z. There's no redo yet.
>>
Isn't Lisp pretty outdated? Why choose it over other languages?
>>
Isn't C pretty outdated? Why choose it over other languages?
>>
>>108685174
fast
>>
(notifications-notify :title "Think!"
:body "What's the best use of your time now?")
>>
>>108684934
lisp being a programmable programming language, it's never outdated. There are implementations of lisp that are well maintained; thus neither the language nor its implementations are outdated.
And when you think it is dead, it's rising again as another form like an eternal phoenix.

https://janet-lang.org/
https://ferret-lang.org/
https://www.eriksvedang.com/carp
https://fennel-lang.org/
https://jank-lang.org/
https://babashka.org/
https://sigmasoldi3r.github.io/charon-lang/


and so and so



[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.