[HN Gopher] Wasmer Edge: WebAssembly on the Edge
       ___________________________________________________________________
        
       Wasmer Edge: WebAssembly on the Edge
        
       Author : syrusakbary
       Score  : 70 points
       Date   : 2023-06-15 16:34 UTC (6 hours ago)
        
 (HTM) web link (wasmer.io)
 (TXT) w3m dump (wasmer.io)
        
       | dedene wrote:
       | How does this work with applications that need databases or other
       | stateful things?
        
         | dynamite-bud wrote:
         | Persistent workloads will be available in the future.
        
         | the_duke wrote:
         | For the moment all workloads are stateless, but you can already
         | connect to external databases. There are "serverless" DB
         | providers like Neon [1].
         | 
         | Persistence is on the roadmap though.
         | 
         | [1] https://neon.tech/
        
           | syrusakbary wrote:
           | And Turso! <3
           | 
           | https://turso.tech/
        
       | [deleted]
        
       | byhemechi wrote:
       | > Wasmer Edge Regions:
       | 
       | > US West Coast
       | 
       | > US East Coast
       | 
       | > Europe Central
       | 
       | Can someone please fill me in on how this is edge, these are the
       | 3 regions every cloud provider has
        
         | preseinger wrote:
         | it is not, "edge" is just a marketing claim here
        
       | preseinger wrote:
       | https://docs.wasmer.io/edge/architecture
       | 
       | this is word salad
       | 
       | good luck
        
       | FireInsight wrote:
       | This post is coated with lots of marketing fluff, while not
       | directly answering the questions I most care about; How does it
       | work? What can I host with it? How does the pricing compare (free
       | tier?)?
        
         | syrusakbary wrote:
         | > How does it work?
         | 
         | If you are interested in knowing how it works I recommend
         | reading the docs [1], we have invested quite some time in them.
         | Please let us know if more info might be useful and we will
         | work on updating them.
         | 
         | > What can you host with it
         | 
         | Right now any static sites and Rust applications (including
         | webservers and other TCP/UDP applications). Support for Node.js
         | and Python is coming very soon!
         | 
         | > How does the pricing compare (free tier?)?
         | 
         | During the private alpha, Wasmer Edge will be completely free
         | for its users.
         | 
         | Once the beta becomes public and available to everyone, pricing
         | is expected to be comparable to Cloudflare Workers. We have
         | also drafted the pricing on the product page [2]
         | 
         | [1] https://docs.wasmer.io/edge/architecture
         | 
         | [2] https://wasmer.io/products/edge
        
           | ryan-c wrote:
           | Can I run an anycast DNS server on this?
        
         | marcosdumay wrote:
         | It has even deployment instructions that don't tell you when
         | your code will run, what resources are available or even on
         | what URL you can access it. They say you can host a tokio
         | server, but there's no mention of database or filesystem.
         | 
         | I imagine that admin panel has those answers, but well, I'm
         | really not doing a deployment to see it. (I'm not even creating
         | an account.)
        
           | ignoramous wrote:
           | > It has even deployment instructions that don't tell you
           | when your code will run
           | 
           | You're referring to this?
           | https://docs.wasmer.io/edge/quickstart/http-server
           | Personally, I found it pretty instructive.
           | 
           | The current regions are us-east, us-west, and eu-central:
           | https://docs.wasmer.io/edge/architecture
           | 
           | > _but there 's no mention of database or filesystem._
           | 
           | The docs do point out that stateful workloads are in their
           | plans.
        
       | joshmarinacci wrote:
       | I like this way of making software, but calling 'Edge' and saying
       | decentralized is confusing. This is a service that hosts my
       | software on their computers. How is this different than AWS or
       | CloudFlare or any of the other cloud providers? I understand
       | their VM tech is different, but what does makes it 'Edge' or
       | 'decentralized'?
        
         | tough wrote:
         | It usually involves multiple hosts in different geo-location
         | areas so you run the server code also closer to the user,
         | vercel does this too
        
       | v7n wrote:
       | Just today I was hacking together something to enable spawning
       | gRPC endpoints on remote host that would run as WASI modules.
       | Didn't get far with wasmer-go bindings so I went with Wazero for
       | now, but I hope to see the former getting some love.
        
       | jadbox wrote:
       | I wasn't quite sure what kinds of deployment are supported. I
       | clicked on the next.js link but it just redirected to the same
       | page.
        
         | the_duke wrote:
         | There are some early docs on this here:
         | https://docs.wasmer.io/edge/learn/deployment-modes
         | 
         | TLDR: support for WASIX [1] enabled builds that can start a web
         | server (Rust with axum works well, Python and PHP are coming
         | soon), and WCGI, with which you can use all languages that
         | currently have WASI support , by using the standard CGI
         | interface.
         | 
         | We'll also add support for standard WASI with pre-opened
         | sockets, which will add support for a bunch of additional
         | ecosystems (like dotnet / C#), but haven't gotten around to
         | that yet.
         | 
         | If you are asking more about how code is managed and executed:
         | stateless, spawned on demand is the default. Proxy mode will
         | re-use instances for multiple requests. Stateful/persistent
         | instances with persistent volumes are on the horizon.
         | 
         | [1] https://wasix.org/
        
         | syrusakbary wrote:
         | With the rush we forgot to update some of the cases in the
         | product page, thanks for the feedback! We'll update them
         | shortly.
         | 
         | Right now we are starting with Rust (with full networking with
         | tokio) and static sites.
         | 
         | Node.js (allowing Next.js to be fully runnable) and Python
         | (allowing Django and Flask) support will be coming soon!
        
           | eins1234 wrote:
           | Also curious about how Node.js support would work?
           | 
           | I've heard about efforts to compile SpiderMonkey to WASM to
           | run JS, but never V8 and the entirety of Node.js. That would
           | be super exciting if that's what you're looking to
           | accomplish. Would love to follow along and contribute if this
           | is part of an open source effort!
           | 
           | Curious if you think cold starts could be a problem with this
           | approach? Share-nothing architecture sounds great until you
           | realize you have to load the entirety of V8 and Node.js on
           | every request, but maybe you've figured out some way to work
           | around that?
           | 
           | Also, how do you think the lack of JIT could affect real-
           | world JS runtime performance? Or is there a solution for that
           | too?
        
           | ushakov wrote:
           | How are interpreted languages possible in wasmer?
        
             | syrusakbary wrote:
             | You can compile the interpreter itself (such as CPython) to
             | Wasm/WASIX and let Wasmer do it's thing :)
        
               | ushakov wrote:
               | What about third-party modules? Next.js depends on SWC,
               | which is written in Rust. Will it run on wasmer?
        
               | syrusakbary wrote:
               | It's a technical challenge but we believe is fully
               | doable.
               | 
               | BTW, SWC is already powered by Wasmer!
        
               | duped wrote:
               | How is swc "powered by" wasmer?
        
               | refulgentis wrote:
               | [dead]
        
               | the_duke wrote:
               | SWC uses Wasmer for its plugin system to execute WASM
               | plugins.
        
       | maxmcd wrote:
       | Wasmer movin' fast and breaking things trying to make WASM real
       | (and VCs happy).
       | 
       | Bytecode Alliance moving slow and steady. Does wasm have sockets?
       | Maybe?
       | 
       | Don't trust Wasmer and don't like their big JVM-style moves, but
       | I guess it's nice to see wasm happening!
       | 
       | All I need is wazero and wasmedge and wasmtime (and toy programs
       | that don't do much).
        
         | syrusakbary wrote:
         | Feel free to request access to Wasmer Edge and let us know your
         | thoughts once you try it.
         | 
         | I believe you will end loving it (btw, I share your love with
         | Wazero... their team is awesome! <3)
        
       | paulgb wrote:
       | Congrats on the launch. Other wasm PaaS services are focused on
       | HTTP endpoints where the wasm modules are run ephemerally, which
       | is cool, but this gets me excited because it's more general. As I
       | understand it, this could replace many of the things people
       | containerize as network services (in a sibling comment you
       | mention using it to serve DNS!)
       | 
       | If you use tokio in this, is it effectively a single-threaded
       | tokio runtime, or do you have a way to take advantage of multiple
       | cores?
        
         | the_duke wrote:
         | We use WASIX [1] to enable multi-threaded tokio inside
         | Webassembly.
         | 
         | That's actually how we have implemented static sites.
         | 
         | For each site a a WebAssembly instance is spawned that runs a
         | tokio static-web-server [2], which is multi-threaded and
         | concurrently handles requests.
         | 
         | That way the Edge serves static sites in the exact same way as
         | you can run them locally (with `wasmer run wasmer/docs`, for
         | example).
         | 
         | [1] https://wasix.org/
         | 
         | [2] https://github.com/wasix-org/static-web-server
        
       | GeorgeHahn wrote:
       | How does this compare with Fermyon's WebAssembly platform?
        
         | styren wrote:
         | I'd also really love to hear an answer to this question. The
         | difference isn't really clear from the comparison on this page:
         | https://wasmer.io/products/edge
        
       | syrusakbary wrote:
       | Hi HN!
       | 
       | I'm Syrus, from Wasmer. We have created Wasmer Edge as a powerful
       | alternative to the Clouds. An alternative that allows reusing the
       | codebases that worked in the Cloud without rewriting them to
       | custom SDKs (such as Amazon Lambda, or Cloudflare Workers), and
       | running them at CDN-like prices.
       | 
       | With Wasmer Edge you can use a normal http-server in any language
       | or even write a full DNS server based on it. We are incredibly
       | excited of the paths that will open ahead.
       | 
       | For those interested, here's the document showcasing how
       | everything is architected:
       | 
       | https://docs.wasmer.io/edge/architecture
       | 
       | Feel free ask any questions you may have here, myself and the
       | team will be incredibly happy to answer them!
        
         | [deleted]
        
         | moralestapia wrote:
         | Hi Syrus, this looks great and I'm an early adopter of WASM and
         | Wasmer so anything new on this end is interesting to me.
         | 
         | That said,
         | 
         | >Join the waitlist to try Wasmer Edge today and experience the
         | difference for yourself.
         | 
         | ... this was very anticlimactic, it made me look away,
         | honestly.
         | 
         | Could you just let us all in?
        
           | syrusakbary wrote:
           | I feel your pain. We need to scale it slowly to provide the
           | best experience for the people and companies using it
           | (including tight and free support!) but hopefully we will be
           | able to open the service to everyone soon.
           | 
           | I guess we really internalized YC's motto: we rather have one
           | person having a great experience and loving us, than 10
           | liking us with an ok experience than 100 using us with a poor
           | experience ...and the waitlist helps on that quest.
           | 
           | Although it seems there's a good chance you'll love the
           | product. Feel free to message me to syrus@wasmer.io and we'll
           | be in touch soon!
        
       | ofrzeta wrote:
       | I don't get what "the edge" is here. I understand what the edge
       | is with Cloudflare and how it makes sense to run certain
       | applications there but Wasmer doesn't have this kind of
       | infrastructure, does it? Is there any difference to a very small
       | CDN (or APN - application delivery network)?
       | 
       | Now when I read about the architecture and the locations it just
       | seems like ordinary cloud hosting, albeit serverless, to me. I
       | can't make much sense of phrases like "The core design of what
       | makes up the Wasmer Edge code base is a distributed monolith"
       | either.
       | 
       | So thanks in advance for any help :)
        
         | ignoramous wrote:
         | I asked bard and this is what it conjured up:
         | 
         | > You're a master at communicating technical concepts to
         | developers by being concise, removing fluff, and speaking
         | plainly without any marketing speak. Please explain what the
         | following means...                 Sure. Here is my explanation
         | of the quote you provided:              1. Distributed
         | monolith: A distributed monolith is a software architecture
         | that combines the benefits of both monolithic and microservices
         | architectures. Like a monolith, all of the code for a
         | distributed monolith is contained in a single binary. However,
         | like a microservices architecture, the code is divided into
         | independent libraries that can be deployed and scaled
         | independently.       2. Separation of concerns: Separation of
         | concerns is a software design principle that breaks down a
         | software system into smaller parts, each of which is
         | responsible for a single, well-defined task. This makes the
         | system easier to understand, maintain, and evolve.       3.
         | Rust libraries: Rust is a programming language that is designed
         | for speed, safety, and reliability. Rust libraries are compiled
         | into machine code at compile time, which makes them faster and
         | more efficient than interpreted languages like Python or
         | JavaScript.       4. Scalability: Scalability is the ability of
         | a software system to handle increased demand without
         | sacrificing performance. Distributed monoliths can be scaled
         | out by adding more nodes to the system. This makes them a good
         | choice for applications that need to be able to handle a large
         | number of users or requests.
         | 
         | Sounds convincing.
        
         | CharlesW wrote:
         | > _I don 't get what "the edge" is here. I understand what the
         | edge is with Cloudflare and how it makes sense to run certain
         | applications there but Wasmer doesn't have this kind of
         | infrastructure, does it?_
         | 
         | It does, and the product page (https://wasmer.io/products/edge)
         | makes it a lot clearer than the linked announcement that Wasmer
         | Edge is basically "Cloudflare Workers for Wasm".
         | 
         | The chart at the bottom of the page1 shows what Wasmer thinks
         | Wasmer Edge completes with -- Cloudflare Workers, Amazon
         | Lambda, Fly.io, and "Cloud" (whatever that is). The most
         | significant differentiator seems to be that Wasmer Edge runs on
         | browsers and phones in addition to servers in the cloud, which
         | makes it "edgier" than the alternatives.
         | 
         | 1 Note that it calls the service "Wasmer Deploy" instead of
         | "Wasner Edge", which I assume is a mistake.
        
       | dial9-1 wrote:
       | so it's just the "drag & drop .jar file into production"
       | reinvented
        
       ___________________________________________________________________
       (page generated 2023-06-15 23:01 UTC)