Results 1 to 6 of 6
  1. #1
    rchiu5hk is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default what is scala.js?

    Hi all,

    I want to confirm what I think.
    Is scala.js can make server-side (Any example?) and client-side (based on node.js to generate javascript) scripts?
    Actually I find more resource on client-side.
    But on server-sider, it seems less. Whether scala.js having db connection framework? Or integrate with scala db connection? Or what is difference between scala.js and scala? is it similar to javascript and java??
    Last edited by rchiu5hk; 09-05-2017 at 03:51 PM.

  2. #2
    asdfg is offline Senior Member
    Join Date
    Nov 2016
    Posts
    157
    Rep Power
    2

    Default Re: what is scala.js?

    As far as I know, PHP+MySQL is server-side. JavaScript is client-side.
    "A safer way to build robust
    front-end web applications!"
    So definalely for decorations, Or im missing something.

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,939
    Rep Power
    7

    Default Re: what is scala.js?

    Quote Originally Posted by asdfg View Post
    As far as I know, PHP+MySQL is server-side. JavaScript is client-side.
    "A safer way to build robust
    front-end web applications!"
    So definalely for decorations, Or im missing something.
    Where did OP mention PHP? He is asking about scala.js. PHP is definately server-side, but in no way related to scala.js. And these days Javascript can also be used serverside. Take a look at React for example. It would run on node.js serverside, rendered partially and the resulting code is transmitted to the client where it is processed even further.

    Having a [L|W]AMP stack is getting vintage. It still works, but there are a lot more technologies available these days. So don't go shouting PHP+MySQL when you hear the term "server side".

    @OP: Why not use Scala as a backend? You don't need scala.js for that. Give the Play Framework a go.


    Required links:
    https://css-tricks.com/server-side-react-rendering/
    https://duckduckgo.com/?q=rendering+...rver+side&t=hw
    https://www.playframework.com/
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  4. #4
    rchiu5hk is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default Re: what is scala.js?

    Thanks SurfMan,

    Is Play framework a full stack one? It can be web framework and has framework for backend such as ORM...

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: what is scala.js?

    As with any other web framework, you plug in the bits you need.
    It does work best with Scala as the language. I got the impression that the Java side was a bit of an after thought when I worked on it.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    231
    Rep Power
    8

    Default Re: what is scala.js?

    Maybe Im half a year late. The main starting tutorial for Scala.js is this: Hands-on Scala.js. Its also decribing client-server programming. Scala, like Java, is a JVM-language, but Scala.js compiles Scala into JavaScript instead. You can use almost all Scala-facilities, except the normal use of Java-libraries (it cant translate those into JavaScript), and some things like reflection. So it's mostly but not only used for front-ends.
    An client-server project will contain code for JS (client), code for the JVM (server, or (generated?) JS-servercode in node.js. I dont have experience with this, but node.js is not needed for the client side as OP is suggesting), and shared code (JVM and JS). You can combine them in one project while developing (cross-compiling).
    Bigger projects will use all kinds of libs (like jQuery or AngularJS on the client vs. DB- and other frameworks on the server), and shared code used on both sides.
    But basically you can do without all this and make Java-applet-like applications for a website, programming in Scala, producing JavaScript.
    And no, the relation Scala-Scala.js is in no way similar to the relation Java-JavaScript. Scala.js is pure scala, using a large subset of "scala.jvm".
    No bug ever had to calculate its fitnessfunction.

Similar Threads

  1. Scala 2.7.0-final
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-01-2008, 11:30 PM
  2. Scala 2.6.0-RC1
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-28-2007, 08:38 PM
  3. Scala 2.5.1-final
    By Jamie in forum Java Software
    Replies: 0
    Last Post: 06-14-2007, 04:09 PM
  4. Scala 2.5.1-RC1
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-06-2007, 11:23 AM
  5. Scala 2.5.0-final
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-22-2007, 07:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •