Lisplog

Blogging in Lisp

Search

Feed Aggregator

Rendered on Tue, 17 Mar 2020 13:02:19 GMT  newer latest older 
Next udpate: Tue, 17 Mar 2020 13:30:00 GMT feeds

Is it possible to use Elm with a reverse proxy?

via Elm - Latest posts by @ni-ko-o-kin Nikolaus Wettstein on Tue, 17 Mar 2020 07:55:42 GMT

I think reactor is made only for development purposes. For production you should compile elm to js with something like this elm make src/Main.elm --optimize --output=elm.js and serve it with all the other static content you have.

Extending an existing record

via Elm - Latest posts by @jessta Jesse McNelis on Tue, 17 Mar 2020 04:52:24 GMT

You will need to write out all the fields, the record update syntax no longer allows you to change the type of the record you’re updating by adding additional fields or changing the type of fields.

This was something that existed in an older version of Elm, but it caused a lot of confusion, made compiler error messages harder to do well and was a very rarely used feature of records.

People from an OOP background often see extensible records as a way to start modeling the inheritance style they’re used to but they’re really not designed for that.

Richard has a really nice talk about using extensible record types that will help you get a better idea about what they’re designed to provide.

Extending an existing record

via Elm - Latest posts by @DullBananas on Tue, 17 Mar 2020 04:06:15 GMT

If I have this type alias:

type alias Point2 a =
    { a
    | x : Int
    , y : Int
    }

How do I take a record of type Point2 {} and add a z value to turn into a Point2 { z : Int } record? I tried making a function like this:

makePoint3 : Int -> Point2 {} -> Point2 { z : Int }
makePoint3 z point2 =
    { point2 | z = z }

But the compiler says I can’t add a z field to a Point2 {} record. I know I can do this instead:

{ x = point2.x
, y = point2.y
, z = z
}

But I don’t want to have to do that because it’s very repetitive.

Using Elm for parsing deeply nested XML

via Elm - Latest posts by @DullBananas on Tue, 17 Mar 2020 03:43:25 GMT

I’m figuring it out now. I started rewriting my parser several hours ago and it’s going well. I’m using function pipelines to do it. But I am having a problem with records. I will make a separate post about that. Again, thanks for helping when Stack Overflow didn’t.

Is it possible to use Elm with a reverse proxy?

via Elm - Latest posts by @krax krax on Tue, 17 Mar 2020 02:16:08 GMT

Hi, beginner question here, though I think its more of server question than an Elm question.

I was wondering if it makes sense have a reverse proxy for Elm? For example, with apache/nginx/php you can use one server run php, and the other to serve (and cache) static files. Elm only generates static files.

Would there be any optimisations to serve some static files (eg images, css) on port 80 or 443 for nginx server, and serve html and js on an elm proxy server on port 8000 with reactor? Even though html and js files are static? Out of curiousity, I tried use a nginx/reactor reverse proxy set up, only to realise it doesn’t work because of the reactor file viewing component.

Would one just load the elm project as static files on Nginx? Are their any specific best practices using Elm with Nginx?

thanks!

LIFF ports for Elm

via Elm - Latest posts by @rupert Rupert Smith on Mon, 16 Mar 2020 22:12:33 GMT

Yes, that looks right. You also corrected my mistake (which I also fixed above). Its not SomePort : X -> Cmd msg it is as you have done it type alias SomePort = X -> Cmd msg.

Elm on mobile platforms

via Elm - Latest posts by @justgook Roman Potashow on Mon, 16 Mar 2020 19:15:00 GMT

Also I have plans to create webgl-UI fo my Tile map editor , based on justgook/webgl-playground - that would allow me using already known technologies build “native” / mobile aps

Implementing Elm podcast episodes are LIVE!

via Elm - Latest posts by @wking-io Will King on Mon, 16 Mar 2020 16:33:17 GMT

Okay so I have not done the best job of sharing these as they have been coming out, buuuuut Season One of the Implementing Elm podcast is LIVE! :slight_smile:

If you have taken a listen go for it! I would love to get your feedback / where I should go next.

PS - If you have listened and like it a review on your podcast player of choice would be much appreciated, but no pressure. I just like doing these episodes to help the community.

LIFF ports for Elm

via Elm - Latest posts by @wingyplus Thanabodee Charoenpiriyakij on Mon, 16 Mar 2020 16:28:31 GMT

Thanks for your reply. I open a PR to confirm with you that I understand you right here https://github.com/wingyplus/elm-liff/pull/4/files. It seems the library needs to tell user what exact name of port to user to avoid unexpected working in the library. I start thinking that I can provide a shell script or node command line tools (can bundle with npm package) to initialize port to avoid this situation.

Help with self-hosting fonts on *.elm-lang.org

via Elm - Latest posts by @evancz Evan on Mon, 16 Mar 2020 15:42:35 GMT

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

Feedback for API to build data structure for opaque types

via Elm - Latest posts by @system system on Mon, 16 Mar 2020 15:20:37 GMT

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

Erlang OTP 22.3 is released

via Erlang.org News RSS by on Mon, 16 Mar 2020 00:00:00 GMT

img src=http://www.erlang.org/upload/news/

Erlang/OTP 22.3 is the last planned patch package for the 22 major release with new features, improvements and bugfixes. Below follows some highlights.

Highlights

  • ssl/public_key:
    • Implementation of the key and initialization vector
      update feature, and general hardening of TLS 1.3.
      There are cryptographic limits on the amount of
      plaintext which can be safely encrypted under a given set of keys.
      This change enforces those limits by triggering
      automatic key updates on TLS 1.3 connections.
    • Add support for TLS 1.3 Session Tickets (stateful and
      stateless). This allows session resumption using keying
      material from a previous successful handshake.
    • Add support for key exchange with Edward curves and
      PSS-RSA padding in signature verification.
  • erts:
    • A socket "registry" has been added making it possible to list current open sockets.
    • Add a "full featured" version of getifaddrs in the net module.
  • ssh:
    • The new functions ssh:set_sock_opts/2 and ssh:get_sock_opts/2 sets and reads option values for
      the underlying TCP stream.
    • Changes to the internal api of the experimental ssh_dbg tool.
  • common_test: The ct_property_test has now a report function for
    results of stateful testing.
  • stdlib:
    • Implement uri_string:resolve/{2,3} that can be used to
      resolve a URI reference against a base URI.
    • In gen_statem it is now possible to change the callback
      module for a running server. See gen_statem's
      documentation for change_callback_module,
      push_callback_module, and pop_callback_module.

For more details see
http://erlang.org/download/otp_src_22.3.readme
Pre built versions for Windows can be fetched here:
http://erlang.org/download/otp_win32_22.3.exe
http://erlang.org/download/otp_win64_22.3.exe
Online documentation can be browsed here:
http://erlang.org/doc/search/
The source tarball can be fetched here:
http://erlang.org/download/otp_src_22.3.tar.gz
The documentation can be fetched here:
http://erlang.org/download/otp_doc_html_22.3.tar.gz
The man pages can be fetched here:
http://erlang.org/download/otp_doc_man_22.3.tar.gz
The Erlang/OTP source can also be found at GitHub on the official Erlang repository:
https://github.com/erlang/otp
OTP-22.3

Thank you for all your contributions!

Create Elm App is giving errors

via Elm - Latest posts by @ChrisWellsWood Chris Wells Wood on Mon, 16 Mar 2020 12:06:20 GMT

Welcome @Victory_Okhormhe! Not too familiar with using NPM on Windows, could it be a permission problem with using the -g flag?

Didier Verna: TFM 1.1 "Carolingan Miniscules" is released

via Planet Lisp by on Mon, 16 Mar 2020 00:00:00 GMT

I'm happy to announce the release of TFM version 1.1 "Carolingan Miniscules". TFM is a TeX Font Metrics parser library for Common Lisp.

This release provides support for font scaling and freezing. Scaling is done, as in TeX, by overriding the font's design size, all other dimensions remaining relative to it. Freezing, on the other hand, converts all relative dimensions into absolute ones, potentially saving a lot of run-time arithmetic computation.

Get it at the usual place.

LIFF ports for Elm

via Elm - Latest posts by @rupert Rupert Smith on Mon, 16 Mar 2020 10:42:57 GMT

Hi, you cannot publish a ports module, but there is something of a workaround for that.

Suppose your module looks like this:

port module MyAwesomeLib exposing (somePort)

port somePort : String -> Cmd msg

You can change it instead to be:

module MyAwesomeLib exposing (SomePort)

SomePort : String -> Cmd msg

Now anyone wanting to use your package needs to define the port themselves in their application. They will also need the corresponding javascript side code. You can make this easier for them by:

  1. Describe in the README exactly what ports they need to set up in the application, and what they need to be called. So tell them to put this in the application, along with the other instructions on how to use it:
    port somePort : MyAwesomeLib.SomePort
  1. Publish your javascript code on npm, so that it can easily be added as a dependency in package.json. OR if its just a very short snippet, you could put the javascript code in the README. There will need to be a short snippet in the README anyway, to show how to wire the port up:
    app.ports.somePort.subscribe(request => {
        callYourJSLib(request);
    });

Use SpaceVim as general IDE for elm

via Elm - Latest posts by @system system on Mon, 16 Mar 2020 10:19:24 GMT

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

Elm on mobile platforms

via Elm - Latest posts by @justgook Roman Potashow on Mon, 16 Mar 2020 09:21:11 GMT

Regarding native stuff - i had successfully build elm into native app for mobile using Ejecta (https://impactjs.com/ejecta) - works great - problem it is webgl based,
Same stuff was done for desktop - using glfw-raub, image-raub, webgl-raub and pkg
Example of pkg way

Pros:

  • All works in native view (OpenGL)
  • There is no visible JS code

Cons:

  • Requires some mock code - to wrap DOM in node
  • Works only with WebGL based apps

Suggestion:

We can make in the same way wrapper around “native” components, just by using Html.node.
Then just use some build DOM wrapper (like Ejecta) - that will capture all events / element creation from elm - and just do native stuff based on that. With that way you will not need to use any custom Elm -> Targed View Builder - just bare elm, with UI lib, that can target customElements in a browser, and other stuff in mobile apps

Using Elm for parsing deeply nested XML

via Elm - Latest posts by @DullBananas on Mon, 16 Mar 2020 03:36:26 GMT

I already tried those libraries, but I probably still need to use one of those. I just need to know exactly how I can use them for the type of XML format that I’m dealing with here. But thanks for trying to be helpful. Already having a better experience with this site than with StackOverflow.

I will try putting the XML code on some other website. I can’t put it on GitHub because my account there is flagged (probably because of a repository I created that said something like “star this repo or else you are gay”), and I don’t want to put the XML code directly in here because it’s very large.

 newer latest older