Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming

JavaScript- (Not Python-) Defined Neutral Networks? Deno 1.8 Supports WebGPU (infoq.com) 51

InfoQ reports: Deno 1.8 recently shipped with plenty of new features, including WebGPU support, internationalization APIs, stabilized import maps, support for fetching private modules, and more. The Deno permissions API is now stable. Deno 1.8 additionally ships with TypeScript 4.2.

The release note explained the motivation behind the support for the WebGPU APIs as follows:

These days, most neural networks are defined in Python with the computation offloaded to GPUs. We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed. Providing WebGPU support out-of-the-box in Deno is a step in this direction. Our goal is to run Tensorflow.js on Deno, with GPU acceleration. We expect this to be achieved in the coming weeks or months.

WebGPU is an API originally proposed by Apple that exposes the GPU computation functionality available on many devices. WebGPU may provide better performance than WebGL in tasks that benefit from parallel processing — as often occurs in scientific computing, machine learning, graphics and games development...

Deno users can upgrade by running deno upgrade in a terminal.

This discussion has been archived. No new comments can be posted.

JavaScript- (Not Python-) Defined Neutral Networks? Deno 1.8 Supports WebGPU

Comments Filter:
  • by dfghjk ( 711126 ) on Saturday March 06, 2021 @06:44PM (#61131610)

    really putting the "Editor" in "EditorDavid". Do these people even know what an editor does?

    • Neutral network? I gess the editor never read this AI koan: [catb.org]

      In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.

      “What are you doing?”, asked Minsky.

      “I am training a randomly wired neural net to play Tic-Tac-Toe” Sussman replied.

      “Why is the net wired randomly?”, asked Minsky.

      “I do not want it to have any preconceptions of how to play”, Sussman said.

      Minsky then shut his eyes.

      “Why do you close your eyes?”, Sussman asked his teacher.

      “So that the room will be empty.”

      At that moment, Sussman was enlightened.

    • He is basically a moron.

      /Oblg. You had one job! /s

  • Net neutrally?

  • Unacceptable!
    It should be written in webJavaScript!
    So I can run it in my webChrome, on my webLinux [copy.sh]!

    I've got a fever! And the only prescription ... is more web!

  • Ideal language (Score:5, Insightful)

    by phantomfive ( 622387 ) on Saturday March 06, 2021 @07:42PM (#61131716) Journal

    We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed.

    They don't give any justification or even reasons why they believe this. To begin with, it would be helpful if NumPy and Pandas were also ported. Secondly Javascript might be an adequate language for "expressing mathematical ideas" (I would argue APL is better, which discounts Javascript from being 'ideal'), but certainly saying Javascript is the ideal language lacks imagination.

    Any time someone says they've found the ideal language for something, give them a lollipop.

    • by Dracos ( 107777 )

      Because their reasons can't possibly be rational. Javascript is propelled by hype and a desire to achieve total language monoculture.

      • A big reason for it: Every phone supports JavaScript and SVG via a browser. Maxima and ActionScript are no longer needed. Run-anywhere code is not Java but Javascript, even though the language is a bastard, ECMA standards be dammed. It also lacks a stand-alone IDE.
      • Neural networks are a monoculture as much of user space is. How much "freedom" is actually dangerous in machine learning? Which will answer the question, "how dangerous can AI be?..". A web born language created to define user's standards driven interaction with the web will/can keep the damage to a minimum.
    • They don't give any justification or even reasons why they believe this.

      They already sorta know javascript, and learning a second language is too hard.

    • by ceoyoyo ( 59147 )

      A neural network is some super simple math, so pretty much any language that can handle a matrix multiply is going to be okay. Even if the matrix multiply is clunky, you're very quickly going to wrap it up in a few layers of abstraction anyway.

      Why would you want to define one in Javascript? Don't know. It's the same as the FastAI guy who suddenly decided Swift was the ideal language. My guess is that whoever is behind this project learned some JavaScript at some point and when you know one language it's nat

    • Re:Ideal language (Score:4, Insightful)

      by fennec ( 936844 ) on Sunday March 07, 2021 @03:52AM (#61132316)
      I think one of the benefits of using anything else than Python is better dependency management. Every time I have to use a Python project or sample that is more than 2 weeks old it's always broken and needs some tweaking. Sure you need to use venv, or your Python version is not the right one, use pyenv, or whatever... I never had this problem with Go, Java or Javascript projects/samples.
      • This. Whatever the âoerightâ language for pretty much anything is, python is not it. The language sucks, the engine sucks, the package infrastructure sucks. The fact that itâ(TM)s the de-facto standard for data-science is an accident that needs to be fixed.

  • WAT? (Score:4, Insightful)

    by CaptainLugnuts ( 2594663 ) on Saturday March 06, 2021 @08:09PM (#61131758)

    We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas

    Javascript is a hateful, spiteful language. The only thing it is ideal for is a demonstration on how not to do things.

    • Re:WAT? (Score:4, Funny)

      by DontBeAMoran ( 4843879 ) on Saturday March 06, 2021 @08:11PM (#61131764)

      It's still better than Perl. I swear that language was created by wizards and warlocks, the code looks like incantations.

      • by Anonymous Coward
        The original perl engine was iteratively optimized until random transmission-line noise was not only considered valid code, but also functioned as a perl engine, v2.0 And we're on perl v5.0 now...
      • It's still better than Perl. I swear that language was created by wizards and warlocks, the code looks like incantations.

        That's the fault of the coder, not of the language itself. Well-written and well-commented perl should be easy to read and follow.

        Well, I suppose you can blame the language for making that sort of code *possible*, although most languages have that issue. It's just that some perl coders seem to see writing indecipherable code as being some bizarre badge of honor.

        • Well-written and well-commented perl should be easy to read and follow.
          Well written code is commented with explanations "why are you doing this in this way", e.g. why does the loop start at 1 and not 0, or why does it go to length - 1 and not length.

          Perl code needs comments that explain "what is that supposed to do", pretty bad "comments" according to my standard of not commenting anything but having self explaining code by using proper naming.

          I can read my 20 year old C++ code. No way I can read my old Per

      • Trying to read some PERL I wrote years ago gave me PTSD and brain cancer.

      • They had a priest or monk or Paladin, too.

        You can "bless" objects in Perl ...

    • Development (Score:2, Troll)

      by JBMcB ( 73720 )

      JavaScript 1: Hey look, you can make dynamic menus in your web page!
      JavaScript 11: Hey look, you can build your enterprise client, middleware, and backend all in the same language!

      I can't see how 10 revisions of a language is possibly enough to go from the first feature set to the last.

    • And python is what?

    • by jma05 ( 897351 )

      One nice thing about JavaScript is that it seems to have the most transpilers for a scripting language and perhaps is only second to C among all programming languages in transpiler count. After all, few want to actually write in JavaScript.
      I wish Python had as many. I use Coconut lang, there is Hy, but there could be a lot more.

  • by Slicker ( 102588 ) on Saturday March 06, 2021 @09:05PM (#61131840)

    JavaScript is in every way a vastly better language. It's syntax has far fewer quirky aspects and is faster write in, uses far less system resources, and executes much faster.

    Node.js, however, is not ideal. Node.js adds a lot of unnecessary complexity by means of forcing extreme asynchrony. While certainly I believe in asynchrony, forcing such extreme design constraints on others is never good, and in this case, add a very large degree of unnecessary complexity. Here's one better way of doing asychrony in an advanced form of JavaScript:

    x = fork( function(){ .. }, timeout );
    y fork( () => { .. }, timeout); // sharing parent's scope
    The x would be an object described below. The function is what executes on a separate process and the timeout is after when to fail, if not response.

    x.started // date/time asychronous function began
    x.returned // any data returned by the asynchronous function
    x.finished // date/time finished else boolean false until then.
    x.success // boolean true else error message
    x.timeout // the timeout given to it

    The primary maintainer of Node.js fails to understand the beauty of the concepts of prototype object-orientation and loose data types. Furthermore, Node.js has really created a mess with the npm package system. A strongly believe a new server-side JavaScript should be written, likely also based on the V8 engine.

    Another thing I'd do:

    when( condition ) { .. }

    In the above, each variable within the condition would be marked as part of a "when". Any modification of a value and the "when" is re-evaluated. However, the "when" statements would be restricted to scope. If abused, this could be very consumptuous of computation resources but when used well, it could greatly simplify a lot of complexity and also greatly reduce the potential for bugs.

    --Matthew C. Tedder

    • I'm not sure if you're dyslexic, but the rest of us are talking about Deno, not Node.
    • Or... just use Promoses and a sync/await like everyone else...


    • x.started // date/time asychronous function began
      x.returned // any data returned by the asynchronous function
      x.finished // date/time finished else boolean false until then.
      x.success // boolean true else error message
      x.timeout // the timeout given to it

      Seriously, if you would write bullshit like this in a shop I worked you would not be fired, but fired at.

  • That aside, when is someone going take designing an open source GPU seriously? I mean I know there are various abandoned attempts .. but we need a RISC V of GPUs .. it isn't cool that there's basically only nVidia and AMD making GPUs. (ARM Mali architecture doesn't count .. it's only for mobile phones).

    • by ceoyoyo ( 59147 )

      Intel makes GPUs. Apple does now too. And whatever that thing Apple used in MacBooks before M1. There are a lot of GPU manufacturers. There are two that compete at the high end, because making cutting edge GPUs is pretty difficult.

    • WebGPU is the spawn of idiots, as is WebAsm.

      WebGPU allows access to compute resources of your GPU from web pages. It would seem specifically to allow injection of cryptominers through malware. The same goes with WebASM.

      • Deploying machine learning to a neural network assumes that a learning domain exists. If a goal is to deploy a a new service or application in to an existing neural network domain what is a better option than a java based language? More options exists but it seems the the original negatives exist no matter what platform you use since users are allowed to design/interact only with the application/presentation service layers of any environment, a web environment. Maybe a cloud environment who's service layers

Scientists will study your brain to learn more about your distant cousin, Man.

Working...