Learn Rust for building webapps?

Should I learn Rust to build webapps on the Safe Network? I didn’t see it listed on the FAQ, but I did see python and node.js. Can you use Rust to build webapps? I know that it’s used for the libraries, but I’m not sure what the protocol is for building SafeApps. Would love to get started…and always looking for an excuse to learn a new language. Thanks!

5 Likes

Yes rust is native for us, python and node (and many others) will be bindings so yes rust will work for you. Nice to get into systems languages as well, nice array of skills then.

4 Likes

Thanks for the Quick reply. This is good news, I’m gonna pick this up. Thanks again!

3 Likes

Not if you mean webapps in the traditional sense, because these would normally mean HTML/Javascript on the client, and something else (many options) on the server. But with SAFE there is no server, so you are left with what can be run in a browser.

You can though write apps to run from SAFE in any language, the difference being they will run native (code compiled or interpreted) on the client, which usually means providing different binaries for different clients (PC, mobile, tablet, Windows, Linux, OSX) which makes it more complicated than a web app in the sense I’ve used it.

I’m hopeful of being able to create an easy to use framework for web apps, that would rely on the user having just a web browser and a SAFE browser plug-in, but I’m nowhere near actually doing this yet. Still researching both web app frameworks and SAFE API.

3 Likes

Could you elaborate on this. Can’t most things be ran in the browser? Or do you mean since there isn’t a tomcat server to host the app you couldn’t write a traditional webapp. So your app would maybe have to be a standalone application pulling in and storing data on the Safe Network. Am I thinking about this in the right way?

2 Likes

Hi Johnny and welcome, the first reply you received here was from the inventor/ team leader :wink:

As a developer you are in the envious position of being rewarded by the network as (1) a farmer (by installing a vault) (2) As an App developer (choose a language binding) (3) As a core developer (Rust)

By learning Rust, you will come to understand the ‘Language of the Network’ and be in a good position to create apps that take advantage of the SAFE design pattern…which is one heavily influenced from the simple, repeatable patterns found throughout nature.

A bounty program is currently being implemented to encourage more Rust developers onto the project.

2 Likes

Welcome to the forum!

I think at least 3 ways of doing Apps are possible. When people run SAFE on their system (just like JAVA) you should be able to build a Windows program (desktop-link that point to a .exe-file etc.) It can make use of the SAFE-API and write and read to the virtual disk that gets mounted by the SAFE-software.

Another option is to run SAFE and have a plugin for Firefox. That’s where you can browse SAFE-sites and these can be made as an App as well. Just like Chrome has it’s own app-store. So people don’t really feel the difference between an App or a website in this option.

Another way is using the SAFE App Launcher. This is different from a browser or a native (.exe) file. This will probably use JAVA-code. A peek inside can be found here:

So, a lot of different options.

3 Likes

[quote=“chrisfostertv, post:6, topic:4414”]
the first reply you received here was from the inventor/ team leader
[/quote] That was pretty cool, Chris! I’m pretty excited to get started. I’m already going through the Rust docs. I’ll read the ‘Language of the Network’ post today. I’m seeing all the pieces come together, but I’m gonna admit, it makes my head hurt a bit. Thanks for the info!

2 Likes

Yes they can, and this is what I mean by a traditional web app - a server program accesses data held on the server and delivers HTML/CSS/Javascript to the browser. You can run any code the browser understands, sometimes needing an extra plugin (eg. for Flash, or Silverlight etc.)

No, I don’t mean that.

It doesn’t have to be, unless you are writing it in code that needs to be run “native” on the client (as would be the case if you chose to create it in Rust, rather than HTML/Javascript.

As I said, I want to create a framework (ie Javascript) that would provide a simple intuitive API for people to build web apps with little or no need to know this is running on SAFE rather than a more traditional web architecture.

You can do it either way, so it depends what you meant by “web app”, which answer applies. Hope that clarifies, if not, ask more. :slight_smile:

1 Like

That makes sense! Thanks!

1 Like

Not a programmer myself but here’s my current understanding.

  • Currently, there is no RESTful API to test against.
  • There is no http on this network.
  • The patent shows the big picture story of SAFE
  • The network only recognises two primary data types, Immutable
    and Structured.
  • Servo is a prototype web browser engine written in the Rust language -> progress
  • A Simple Web App in Rust, Part 1
  • A curated list of awesome Rust code and resources
  • The build order to browse the network may be via (1) Firefox plugin (2) other browser plugins (3) Servo Browser (RUST) (4) Native SAFE OS

The network is:

A key-value store, or key-value database, a computer program designed for storing, retrieving, and managing associative arrays, a data structure more commonly known today as a dictionary or hash.

So anything that runs for example, on Google App Engine/ BigTable or Amazon’s Dynamo will port to SAFE.

  • Anything beyond a static site, will run on a key-value databases like Riak, Cassandra, Redis, Memcached , HyperDex etc
  • There was talk of Single Page Applications running well on SAFE and
    so Polymer and X-Tag (mozilla) would fit that.
1 Like

@chrisfostertv

Currently, there is no RESTful API to test against.

This is already there, and can be tested against as soon as there’s a network running, and until then it is easy to simulate for testing.

There is no http on this network.

This is true, but not a big deal. Point is users will be able to access SAFE websites, web apps, in exactly the same way as they would http/https using a normal browser with the MaidSafe built plugin.

SAFE is for dynamic websites too!

Also, you are incorrect in implying that SAFE is only for static websites (if that’s what you mean - that’s how it reads to me anyway). This is the purpose of the SAFEpress app I’m developing: it’s a dynamic web app that creates dynamic websites and web apps that run on SAFE! :slight_smile:

Sorry that wasn’t clear - this is not a static content generator, but a true CMS, that will build dynamically editable, websites, and blogs with comments. The dynamic capabilities will be extremely simple to start with, but the pages will be generated dynamically, and more features can be added over time. It won’t be WordPress from day one, but I hope people will have a functional blog with comments from day one, and be able to automatically transfer content from WordPress and similar CMS websites. That’s why I am calling this a potential “killer app”.

Note also that @eblanshey is, if I understand it correctly, doing something very similar, building a web forum to run in essentially the same way (over REST using a standard web browser using the MaidSafe plugin).

2 Likes