Lisplog

Blogging in Lisp

Search

Feed Aggregator Page 665

Rendered on Wed, 21 Oct 2020 03:03:48 GMT  newer latest older 

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @hexedhash Giorgio on Wed, 21 Oct 2020 02:51:28 GMT

React Native is 0.63 and is production ready for years

That’s definitely an outlier / exception to the rule … First of all, React Native is developed, financially backed, promoted and heavily used by massive companies. Secondly, there’s the great branding associated with React that React Native piggy backs on. Sure, React Native is not yet in 1.0, but React is and has been for a long time.


Follow-up / edit: My point is, by having a 0.x.y version, you’re already raising eyebrows for folks who may not be fully aware of the language / library / ecosystem. So it’s already an up-hill battle at that point.

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @Chadtech Chadtech on Tue, 20 Oct 2020 23:52:20 GMT

Oh great! Nice job figuring all this out @lydell !

Yes, on my two computers I have 0.19.1-revision2

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @harrysarson Harry Sarson on Tue, 20 Oct 2020 21:04:24 GMT

EEK.

Could you file an issue (ideally with a SSCCE)? I am sorry we broke this for you :grimacing:

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @dta David Andrews on Tue, 20 Oct 2020 20:47:24 GMT

Long-open bugfix PRs are another reason for this perception

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @G4BB3R Gabriel Torrecillas Sartori on Tue, 20 Oct 2020 20:18:51 GMT

This doesn’t mean anything. React Native is 0.63 and is production ready for years, lots and lots of companies use in production. And having less releases is a desirable thing, the correct name is stability, big companies need it. Evan still works full time on the project.

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @KasMA1990 Kasper on Tue, 20 Oct 2020 20:16:01 GMT

It’s a communication issue: the version number implies that the language is not stable (or it would be at 1.x), so people expect things to be changing. But since there doesn’t appear to be a lot of change going on (either in the form of releases or blog posts), it’s easy to assume that the language must be stagnating. You can explain how things work in Elm land of course, but first impressions are still important.

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @berend Berend de Boer on Tue, 20 Oct 2020 19:45:38 GMT

Eh, why would you release a new version of the compiler if the old one is still working fine? Much of the action is in the libraries.

Reasons that people were forced to move from Elm to something else?

via Elm - Latest posts by @mikechean Michael Chean on Tue, 20 Oct 2020 19:11:56 GMT

I come back to Elm every so often just to see if it’s still around. I see the last release was a year ago now, and that brings me to the issue I had convincing my co-worker to look at it. How do you convince someone to seriously consider a project that is not at 1.00 at least and seems to be moribund release wise? I realize that neither of these are the case but to the outsider it sure seems like it.

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @lydell Simon Lydell on Tue, 20 Oct 2020 16:10:27 GMT

Update:

It looks like we’re both right.

elm-test 0.19.1 and 0.19.1-revision2 both work like @Chadtech says.

elm-test 0.19.1-revision3 and 0.19.1-revision4 work like I say.

Sounds like behavior accidentally changed in 0.19.1-revision3. @Chadtech Can you confirm that you’re using elm-test 0.19.1 or 0.19.1-revision2?

Elm parser library in rust

via Elm - Latest posts by @joelq Joël Quenneville on Tue, 20 Oct 2020 14:19:16 GMT

Are you looking for a pre-built package that you can point at an Elm source file and will give you back an AST? Or are you planning to build such a package yourself and you’re looking for a parser-combinator library in Rust?

Efficient Text Editing Buffer

via Elm - Latest posts by @rupert Rupert Smith on Tue, 20 Oct 2020 08:45:22 GMT

Thanks, I never heard of a Gap buffer before, but that looks very close to what I am implementing, its just that I have the ‘gap’ as a separate item being the focus of the zipper.

There was also a link to the ‘rope’ structure apparently used by emacs: https://en.wikipedia.org/wiki/Rope_(data_structure)

And this: https://en.wikipedia.org/wiki/Piece_table, which brings up the issue of implementing undo efficiently, something I had not considered yet.

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @lydell Simon Lydell on Tue, 20 Oct 2020 07:21:55 GMT

@Chadtech I can’t get that to work: https://github.com/lydell/elm-test-import

Also I see nothing in the elm-test code that suggests it should work.

WebRTC conference sample with custom elements

via Elm - Latest posts by @system system on Tue, 20 Oct 2020 07:17:40 GMT

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Efficient Text Editing Buffer

via Elm - Latest posts by @MarkHamburg Mark Hamburg on Tue, 20 Oct 2020 05:23:22 GMT

See also https://en.wikipedia.org/wiki/Gap_buffer though not quite on point within a pure language.

Custom Scroll Bar Logic

via Elm - Latest posts by @rupert Rupert Smith on Mon, 19 Oct 2020 22:07:19 GMT

Yes, it does that. Didn’t seem critical to fix it, as I was more interested in the scrolling.

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @Chadtech Chadtech on Mon, 19 Oct 2020 21:13:23 GMT

I am positive that I have this working, because I run tests like this and they do in fact break when things go wrong.

So, I do still have to have a tests/MainTests.elm file. But that file doesnt do anything; it looks just like what I posted before. MainTests.elm merely has import Main at the top. I just read through the tests we have at work, and I notice modules expose their tests tests : Test, so I think maybe that is key.

But, they arent explicitly organized into a heirarchy like with describe "Tests" [ Main.tests ]. I think elm-test really does climb the module heirarchy and run any exposed Test values.

Do you put tests outside the `tests/` folder?

via Elm - Latest posts by @lydell Simon Lydell on Mon, 19 Oct 2020 20:27:10 GMT

it imports Main , which means that everything in Main and everything Main imports will be searched for tests. So any test in any module will be run.

No, that’s not how elm-test works. It only looks for exposed Test values in the CLI args (which defaults to tests/ – a directory arg means “all .elm files deeply within this folder”). I just tried it just to be 100% sure.

So you must be running something like elm-test tests/ src/, or you’re not running as many tests as you think you are. Or maybe you do something like this?

module SomeTest exposing (..)


import Expect
import Main
import Test exposing (..)


tests : Test
tests =
    describe "SomeTest"
        [ Main.tests
        , test "something else" whatever
        ]

Alexander Artemenko: pzmq

via Planet Lisp by on Mon, 19 Oct 2020 18:47:16 GMT

ZeroMQ is a networking library. It is not a message broker and it will not run tasks for you. Instead, it provides simple primitives for different network patterns.

With ZeroMQ you can easily implement these patterns: Request-Response, Pub-Sub, Push-Pull.

I found 3 CL systems implementing bindings to ZeroMQ:

I know, names of the repositories, CL systems and packages are all different. That is the HELL :(

There is also at least two different versions of the zmq:

  • First one is referred by https://www.cliki.net/cl-zmq and included into Quicklisp. But examples from the ZeroMQ Guide not work with this zmq because msg-data-as-is function is absent.
  • The second one is https://github.com/tsbattman/cl-zmq and seems it is the version, used in ZeroMQ Guide. But it is not in the Quicklisp (yet or anymore).

Anyway, both of them are stale and didn't get updates 7-8 years. They are using the old 3.2 version of ZeroMQ. Today we'll talk about pzmq.

PZMQ has some activity in the repository and uses ZeroMQ 4. It does not have docs but it has some examples, ported from the ZeroMQ Guide.

I slightly modified the examples code, to make the output more readable when client and server are running from one REPL.

This snippet shows the server's code. It listens on the 5555 port and blocks until a message received, then responds and waits for another message:

POFTHEDAY> (defun hwserver (&optional (listen-address "tcp://*:5555"))
             (pzmq:with-context nil ; use *default-context*
               (pzmq:with-socket responder :rep
                 (pzmq:bind responder listen-address)
                 (loop
                   (write-line "SERVER: Waiting for a request... ")
                   (format t "SERVER: Received ~A~%"
                           (pzmq:recv-string responder))
                   (sleep 1)
                   (pzmq:send responder "World")))))

The client does the opposite - it sends some data and waits for the response. Depending on the pattern you use, you have to set socket types. For the server, we used :rep (reply) and for client we are using :req (request).

POFTHEDAY> (defun hwclient (&optional (server-address "tcp://localhost:5555"))
             (pzmq:with-context (ctx :max-sockets 10)
               (pzmq:with-socket (requester ctx) (:req :affinity 3 :linger 100)
                 ;; linger is important in case of (keyboard) interrupt;
                 ;; see http://api.zeromq.org/3-3:zmq-ctx-destroy
                 (write-line "CLIENT: Connecting to hello world server...")
                 (pzmq:connect requester server-address)
                 (dotimes (i 3)
                   (format t "CLIENT: Sending Hello ~d...~%" i)
                   (pzmq:send requester "Hello")
                   (write-string "CLIENT: Receiving... ")
                   (write-line (pzmq:recv-string requester))))))

Here is what we'll see when running the server in the background and starting the client in the REPL:

POFTHEDAY> (defparameter *server-thread*
             (bt:make-thread #'hwserver))

SERVER: Waiting for a request... 

POFTHEDAY> (hwclient)
CLIENT: Connecting to hello world server...
CLIENT: Sending Hello 0...
CLIENT: Receiving... Hello
SERVER: Waiting for a request... World
CLIENT: Sending Hello 1...
CLIENT: Receiving... Hello
SERVER: Waiting for a request... World
CLIENT: Sending Hello 2...
CLIENT: Receiving... Hello
SERVER: Waiting for a request... World
NIL

What is next?

Read about Pub-Sub and Push-Pull patterns at the ZeroMQ Guide and try to port them on pzmq.

Also, it would be cool to port all Common Lisp examples from the unsupported library to the pzmq and to send a pull-request.

By the way, there is at least one cool project, which already uses pzmq to connect parts written in Common Lisp and Python. It is recently reviewed common-lisp-jupyter library.

To conclude, this library definitely should be tried if you are going to implement a distributed application! Especially if it will interop with parts written in other languages than Common Lisp.

Custom Scroll Bar Logic

via Elm - Latest posts by @hans-helmut Hans-Helmut on Mon, 19 Oct 2020 20:00:21 GMT

Small bug: Pressing PgUp some times after load causes PgDown not working, until the same number of keypresses is done on both keys. Maybe some underflow?

It is also interesting to see, how the memory-usage increases while scrolling, until the GC started, but not to critical value, I suppose.

Elm parser library in rust

via Elm - Latest posts by @DullBananas on Mon, 19 Oct 2020 15:51:40 GMT

is there a good rust library for parsing elm source code?

 newer latest older