Email or username:

Password:

Forgot your password?
591 posts total
Andrew Tropin

We develop rde on sourcehut, but there is a mirror on github and recently I realized that it has 185 stars already:
github.com/abcdw/rde

How many it is?

Do you know other small to medium sized projects, which only mirrors on github?

#guix #rde #lisp #scheme #guile

Arne Babenhauserheide

@abcdw I tend to not mirror my small projects to github … maybe I should, just for the visibility?

Andrew Tropin

Haha, sometimes it's too true :)

Can we make it some other way, please?)

The labels on the picture:
- proprietary project: Code or starve.
- open source project: Code and starve.
gram

@abcdw Open-source made me rich. In 10 years of writing more than 100 open-source projects, I earned 12 euros in donations πŸ‘€

Andrew Tropin

Using electron app for notes feels like using microwave oven for a timer.

NiceMicro

@abcdw in the late 90's one of my friend's family microwave oven had a timer, and when he told me he'd time some game with the microwave oven, I was like "you'll put in some food just to time the game?", and he was like... "no, no, we can just use it as a timer"...

So yeah.

Andrew Tropin

There are a lot of benefits in mailing list based development, but there are so many ways to do something wrong: send a patch to a wrong message/thread, forget cover letter or In-Reply-To header, attach instead of inline and so on.

Technically all the tools are available, but it takes a tangible amount of time and practice to configure them and start doing everything properly.

Resources like git-send-email.io/ helps, but still doesn't solve the issue completely.

#emacs #git #email

Show previous comments
Colin

@abcdw So Codeberg or...?

I've heard that plenty of people love applying mail-based patches, but the PR/MR system seems less open to user error, as you've mentioned.

Vivien the Trumpeting Elephant

@abcdw I like the patch-over-mailing-list approach as a submitter. I do occasionally mess things up, but usually the reviewers will pardon me for sending a v2.

As for git send-email, I don’t like it much. The "mail user agent" function of git send-email is very unpleasant, because you can’t review what you did, it does not copy the email in your sent folder, you can’t apply filters. While claiming to be the only working MUA (the one you use daily being unworthy of that name).

πŸ’πŸŒ³ Hartmut Goebel

Totally agree. I ended up writing a script for submitting the patch series. And still it is cumbersome.
@abcdw

Andrew Tropin

Ouch, I can't use srfi-64 test-group inside asyncronous code, because it uses dynamic-wind and re-entering fiber's continuation messes up test-runner output:

git.savannah.gnu.org/cgit/guil

#scheme #lisp

test-group usage inside async code on the left and messed up test-runner output on the right.
Andrew Tropin

Another good idea is to make assertions outside of async code.

Ramin Honary

@abcdw You might be have to define your own SRFI-64 test runner object that captures test outputs to a buffer specific to that one test, and then dump the buffer to stdout when the test completes. That way you can re-enter the continuation as often as you like, the output will only go into the buffer for that test.

Andrew Tropin

Implementation of with-pipes function. It can be used for capturing i/o of threads or subprocesses for example.

Does it look like idiomatic Scheme code?

git.sr.ht/~abcdw/guile-nrepl/c

#sheme #lisp

The screenshot of the code in the link, plus a usage example.
Andrew Tropin

It should be call-with-pipes to fit the naming convention.

Ludovic Courtès

@abcdw β€˜with-pipes’ won’t close pipes in cases of a non-local exit of β€˜proc’.

To protect against that, you can wrap the call to β€˜proc’ in β€˜with-exception-handler’ or similar. (It’s tempting to use β€˜dynamic-wind’ but then that would prevent β€˜proc’ or its callees from capturing a delimited continuation that spans the β€˜with-pipes’ call.)

Show previous comments
Ramin Honary

@abcdw As I read this documentation, my understand is that pipes are ordinary POSIX file descriptors, so you are probably responsible for closing them if you create them with the POSIX system calls.

However if you create a Scheme "port" object from a pipe, it seems like (from the manual) that the port object will automatically close the pipe when it is garbage collected:

>

> "A file descriptor can be extracted from a port and a new port can be created from a file descriptor. However a file descriptor is just an integer and the garbage collector doesn’t recognize it as a reference to the port. If all other references to the port were dropped, then it’s likely that the garbage collector would free the port, with the side-effect of closing the file descriptor prematurely.

> "To assist the programmer in avoiding this problem, each port has an associated revealed count which can be used to keep track of how many times the underlying file descriptor has been stored in other places. If a port’s revealed count is greater than zero, the file descriptor will not be closed when the port is garbage collected. A programmer can therefore ensure that the revealed count will be greater than zero if the file descriptor is needed elsewhere."

@abcdw As I read this documentation, my understand is that pipes are ordinary POSIX file descriptors, so you are probably responsible for closing them if you create them with the POSIX system calls.

However if you create a Scheme "port" object from a pipe, it seems like (from the manual) that the port object will automatically close the pipe when it is garbage collected:

Felix Lechner

@abcdw Hi, there seem to be exceptions. "Ports should be closed when they are not needed .... Any error that occurs while writing out that buffered data would also be raised promptly at the close-port, and not later when the port is closed by the garbage collector." gnu.org/software/guile/manual/ "Buffered writes defer error detection (and defer the side effects to the mutable store), perhaps indefinitely if the port type does not need to be closed at GC." gnu.org/software/guile/manual/

@abcdw Hi, there seem to be exceptions. "Ports should be closed when they are not needed .... Any error that occurs while writing out that buffered data would also be raised promptly at the close-port, and not later when the port is closed by the garbage collector." gnu.org/software/guile/manual/ "Buffered writes defer error detection (and defer the side effects to the mutable store), perhaps indefinitely if the port type does not need to be closed at GC."

yourWife

@abcdw simply use call-with-input-file and Guile will close for you like RAII style

Andrew Tropin

10 minutes talk on scientific workflow in Emacs:
- Obtaining new papers from arxiv or other site with rss using elfeed and org-ref.
- Adding it to bibliography.
- Taking notes with org-roam and citar.

youtu.be/5Q9435eIOVI

#emacs #research #academia

Andrew Tropin

PlantUML is sick, it grew up so much since the last time I used it and now it looks really good.

Mind maps, sequence diagrams, BNFs, JSONs, regexps and whatever you want:
plantuml.com/

An example of plantuml sequence diagram from its home page.
Show previous comments
avp

@abcdw I regularly use PlantUML (plantuml.com/) to describe the architecture of my projects and recommend it to my students as the tool for creating diagrams in their graduation projects.

And since I'm an FSM (Finite-State Machines) devotee, I wrote a state machine compiler in Scheme that turns PlantUML state diagrams into working GNU Guile (Scheme) code:
github.com/artyom-poptsov/guil

Teknovis

@abcdw I use it all the time for sequence diagrams and control flow diagrams. Works perfectly for me.

Andrew Tropin

Starting the second stream on lightweight concurrency in Guile Scheme:
youtu.be/FH8IGYUyWVc

Chat and peertube is here:
trop.in/stream

#guile #scheme #fibers #concurrency #lisp

Andrew Tropin

The best way to get all available stuff from textual port I found so far is:
(define (read-all-chars-as-string port)
(let loop ((chars '()))
(if (char-ready? port)
(loop (cons (read-char port) chars))
(reverse-list->string chars))))

#scheme #guile #lisp

otterz

@abcdw neat! short and very readable. wouldn't "char-ready?" also return #f in cases other than EOF though?

Andrew Tropin

After reading and trying to grasp Parallel Concurrent ML paper for a couple of weeks I finally understood most of it and the fact that I probably need to read a book to find the answer to my question ><

people.cs.uchicago.edu/~jhr/pa

Andrew Tropin

I guess half of the people subscribing to me are academics or at least have a solid background in some subject from category and homotopy theories to biology, CS or some other fancy thing. Meanwhile, my H-index: βˆ’273.15 Β°C.

I wouldn't say I feel uncomfortable, but I think I finally need to start publishing papers and find a PhD position (:

lispwright

@abcdw While I didn't plan this out, for programming and systems I recommend seriously studying biology because of all the mechanisms and metaphors you'll learn.

So up to college level general biology, whatever is the equilivent of Helena Curtis nowadays, and molecular genetics is also lots of fun.

Andrew Tropin

Keep experimenting with fibers and for a good reason I need an operation, which waits until thread is exited.

paste.sr.ht/~abcdw/12b2547726c

I implemented it and it works, but obviously blows up the memory. I've not finished a "Parallel Concurrent ML" paper and have a very little clue what I do in block-fn, I'll appreaciate if someone can give me a quick solution for now.

#guile #scheme #lisp #fibers #concurrency

Bahman M.

@abcdw I'd say post this on #Lemmy too. Usually you can hope for decent no-nonsense answers.

lemmy.ml/c/programming & lemmy.ml/c/programming@program are good starting points IMO

Jeff Kreeftmeijer

@abcdw oh wow! I'm sorry, missed this completely. Thanks for packaging it, and great to hear you like it. :)

Andrew Tropin

@migalmoreno collected a number of real-world rde configurations: git.sr.ht/~abcdw/rde#people-s-

Check out those nice approaches for maintaining your home and system configs with guix and rde.

#rde #guix #guile #lisp #nix #nixos

Andrew Tropin

The explanation on what is happenning with #scheme language r7rs standard at the moment:
dpk.io/r7rswtf

The work on r7rs-large is tough, but I hope it will go through this hard times.

#guile #lisp #pl

Go Up