Search Unity

Is Unity planning to kill JavaScript support?

Discussion in 'Scripting' started by gtapperdesign, May 10, 2016.

Thread Status:
Not open for further replies.
  1. gtapperdesign

    gtapperdesign

    Joined:
    May 3, 2016
    Posts:
    3
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    There is no official announcement yet that the language is going to be phased out. But it is going to be phased out. It might take a few years, but I wouldn't count on it hanging around.

    As evidence
    • UnityScript never gets mentioned in any of the various media channels used by Unity
    • No features have been added to UnityScript in years
    • No documentation exists for UnityScript, and Unity has put forward no effort to create the documentation
    • Newer services and engine features are not documented in UnityScript
    There are still a few users that like the language. But slowly they are switching to C#. Once the users drop below a certain critical mass then Unity will drop the language.

    I'd totally suggest starting your next project in C#. The only real reason to use UnityScript is if you are dealing with a legacy code base.
     
    ZJP, sonofbryce, MCrafterzz and 4 others like this.
  3. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    join us on the dark side, we have cookies* :)

    *new members are required to pop to the shops and acquire said cookies, also we're low on milk :D


    on a more serious note: there isn't that much difference between unityscript and c#, most of it is just syntax (type before name vs name before type, return type before function name vs return type after parameters etc.)
     
  4. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    i hope they discontinue that S***.

    C# only.
     
    ArachnidAnimal likes this.
  5. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,532
    ::looks around::

    uh oh, where's that guy with the rat avatar?

    ::rubs hands together::

    I'm hoping this one gets good.
     
    passerbycmc, aer0ace, Ryiah and 3 others like this.
  6. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,825
    Please let JavaScript die. Asset store sellers: please stop using Javascript.
    There is really no reason whatsoever to use it when you can use C#.
    I have noticed a pattern though. It could be just chance but whenever I purchase an asset store item with scripts written in JavaScript, they are very poorly written. No indentations, no caching of components. Completely messy coding. I don't know why this is, it just seems to go along with the territory of Javascript.
    You cant even have compiler warnings disabled in Javascripts. Right now I have over 350 compiler warnings thrown at me every time I compile the projects, all because of Javascripts from the asset store.
     
    Flaring-Afro and SubZeroGaming like this.
  7. Kamilche_

    Kamilche_

    Joined:
    Jan 11, 2015
    Posts:
    75
    Well, they can't give up Javascript support completely, as the WebGL build uses it. But for input scripting, yeah maybe - I use C# all the time myself, and when I encounter Javascript examples of Unity code, I translate to C#.
     
  8. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,532
    What do you mean the WebGL build uses it?
     
  9. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I haven't seen @Tiles in a while. But he normally does pop in just to defend UnityScript. Apparently it's the fault of C# fanboys like me that the language is dying.

    WebGL deploys in JavaScript. That has nothing to do with support for scripting in UnityScript. Two different languages here.
     
  10. ericbegue

    ericbegue

    Joined:
    May 31, 2013
    Posts:
    1,353
    JavasScript? What is that? UnityScript? What is that?
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    Are you referring to @Tiles who only shows up in threads concerning UnityScript? :p

    I don't believe they've planned anything of the sort. That said between new users being guided towards C#, older users being fed up with the lack of support for it, and older users who favored it quitting Unity (Tiles, for the record, doesn't actually make games with Unity last I checked), UnityScript is slowly losing it's market share percentage.

    About the only user I am aware of that is highly active on these forums and still uses UnityScript is @ippdev. That said I do believe there is an active community of developers who still prefer to use UnityScript. They just aren't bothering with these threads.
     
    Last edited: May 10, 2016
    Kiwasi likes this.
  12. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    I would be inclined to think that it will be dropped because its a bespoke language that has zero use outside of unity.

    I also imagine at adds another layer of complexity for development, pushing deadlines.

    I suggest you get on the c# bandwagon before you find your ass on the ground wondering where you went wrong.
     
    Flaring-Afro and Kiwasi like this.
  13. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Its is likely that when the end comes UnityScript will be soft pulled, the same way Boo was. The buttons for making Boo scripts were taken away. The language was removed from the docs. But the compiler was left in. So a Boo script will still compile and run. And if you are willing to mess with it, you can still create new Boo scripts.

    Technically Unity will accept anything that compiles down to compatible IL. I don't see this face ever changing. So you could use languages other then C# if you really, really wanted too.

    Speaking of IL, I doubt that UnityScript will survive the promised .NET/C# version upgrade. I really can't see Unity spending any effort on implementing new features in an unused language. The version upgrade is likely to happen some time between next month and next decade.
     
    Ryiah and JamesLeeNZ like this.
  14. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Death to the UnityScript. Out with the trash! lol

    I've never seen this tile dude, then again, when i see unityscript posted, i leave a comment telling them to use C# and leave lol
     
  15. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    But why will they stop supporting JavaScript?
    It doesn't hurt anyone to have JS support, it requires no maintenance...
    But if they will stop supporting it all of the JS users will get hurt.

    JavaScript is the main reason I chose Unity over Unreal Engine.
     
  16. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    It's because it's not Javascript. Pure and simple. It's UnityScript and they would rather put resources towards their engine then maintain their own language. (This is my speculation as Unity has not said anything official). C# is supported by Microsoft. UnityScript would have to be supported by Unity.
     
    hippocoder likes this.
  17. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,524
    It isn't JS, it's UnityScript.

    IIRC @superpig mentioned that it was starting to cause maintenance issues or holding them back from further optimizing stuff [or something] to keep the js stuff in Unity and they wanted to start phasing it out or stop maintaining. I can't remember the specifics, but I seem to remember something official being said about it in the last ~4 months or so which basically point out that it's going away in the future.
     
  18. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Yes, I think it hurts a lot to keep maintaining UnityScript. It's really a mutation of Boo (or written in Boo), the third language Unity used to support. It's madness maintaining API updates and fixes in more than one language, and costs both development and testing time, plus all the documentation which needs examples.

    UnityScript has felt like it's been deprecated for a long time anyway. People should already have switched when new tutorials became C# only. Half expecting a word filter that removes posts talking about UnityScript soon :p
     
    Kiwasi likes this.
  19. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    As others mentioned, it's not Javascript. I know Unity calls it Javascript, and "Javascript" appears over and over in the docs, and in the editor itself, but it's still not Javascript.

    Supporting UnityScript is not free. Anytime someone posts a JavascriptUnityScript question, someone has to spend the time to answer that question. That's a time cost right there.

    Supporting two APIs is costly in terms of development, features (if X can't be added to one API, it probably shouldn't be added to the other API for compatibility's sake), and QA testing time. Each time Unity has a new release, everything must be tested.

    Even if you were to just let the API "sit there" and add nothing, it still has to be tested for each update, and that significantly reduces QA testing time on their other preferred API, and therefore slows down each release.

    Even if they said "Eh screw it" and stopped testing UnityScript and just let the API sit there, UnityScript users will still get screwed in the long term as unfixed bugs start creeping in, and (in terms of features) you are stuck with rusty bicycles made out of oversized wheels while everyone else is flying around in hovercars.
     
    Last edited: Jul 17, 2017
  20. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    It's true - we are looking to get rid of UnityScript at some point.

    We've not made an official announcement yet because we're still investigating some of the details. It's not something we are doing lightly, and so we want to make sure we have really looked at everything fully before we talk about it. So, there will be a blog post soon, but please hold tight until then.
     
  21. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Uh, you were misled, sorry. Unity doesn't support JavaScript. It support UnityScript, which is a very different language that has been dressed up to look kind of like JavaScript. But it's not even all that close. If you paste any Javascript sample code from the web into Unity, maybe one line in ten will be valid, working code.

    You will have to learn a new programming language, yes. But this is not as daunting a prospect as it sounds. C# is a language that actually has a lot more in common with UnityScript than UnityScript has in common with JavaScript. C# is also a language that has millions upon millions of users worldwide, including people not working in Unity. If you paste C# sample code into Unity, it will almost always work.

    It's much easier to get help on the forums if you're working in C# - the C# userbase in Unity is about 5x larger, and much more likely to be professionals and/or professionally educated (that is, more able to help), whereas any given randomly selected JS user is more likely to be a Unity rookie as likely to be in need of help as the person asking the question. (What I've found is that the majority of the time JS users have their questions answered here, they are answered by C# users who have been using Unity long enough to remember Unity 1.x when it was actually worthwhile to use JS.)

    Plus, Unity's own C# tutorials are excellent, and I have little doubt that part of the process of deprecating the JS language will include copious tutorials to help JS users transition to C#, and most likely software to help convert codebases as automatically as possible.
     
  22. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,524
    I've got my black suit ready and a box of tissues for anyone in need.
     
  23. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Wow. That's the strongest language we've heard on the topic yet.

    It's obvious to anyone that pays attention that it has been coming. But now I'm picking 2-3 years instead of 5-10.
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The baying throng carry the grim remains of UnityScript above their shoulders, showered and blessed with both ignorance and righteousness.
     
    rhys_vdw and WhendricSo like this.
  25. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    I know, I meant UnityScript. It's still easier for me.

    Also could you send a good tutorial that helps UnityScript users learn C#?
    Just in case my whole UnityScript project gets lost. :(
     
  26. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    :(:(:(

    Also - I'm in the middle of making a pretty big project using UnityScript. Will my whole project get lost when you stop supporting UnityScript??
     
  27. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,335
    You announced that it's getting deprecated on the roadmap talk at Unite, so I think it's fair to say that you have made an official announcment.
     
    Kiwasi likes this.
  28. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,335
    What will happen is probably the same thing that happened when they deprecated Boo. There won't be any documentation created anymore, they won't make any promises that it'll work, and they'll remove the button that creates a script in that language.


    It might be that they'll get rid of UnityScript more thoroughly, though. I suspect that Boo's stuck around so long since (I believe) it's used to make UnityScript run. So maybe they'll pull the plug properly and get rid of it all in one big swoop? idk.


    In the mean time, why don't you write code in a good language? Here's an example

    Code (csharp):
    1. import UnityEngine
    2.  
    3. class TestMe(MonoBehaviour):
    4.  
    5.     def Start():
    6.         Debug.Log("hello")
    :p
     
  29. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Just use the Learn section linked at the top. There are script tutorials at all levels.
     
    Kiwasi likes this.
  30. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    Like I said - hold tight, we'll have more info ASAP.
     
  31. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Just stay on the same version of Unity. Unity doesn't and indeed can't remove features from existing versions.

    If your project is big, you probably want to freeze the version anyway.
     
    StarManta and Gua like this.
  32. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    Ok, how can I freeze updates?
     
  33. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    Just... don't ever download a new version. Or if you do, make sure you install it in a different folder - you can have multiple Unity installs.
     
    Kiwasi likes this.
  34. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    But doesn't it update automatically?
     
  35. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,335
    Nope.

    Unity's not got a proper updater, so the only way to update is to re-install the entire fuggin' engine.

    It still pops up a window to nag you about how it's not up to date, though.
     
  36. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    That nag usually starts a while after a new release is out though. The only way to know what patches exists at all times is to read the stickies in the forum. Patch releases are usually safe when you've frozen on a version, everything else you test before you upgrade.
     
  37. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    But better be safe ;)

    What is going on in your profile picture? xD
     
  38. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Maximum paranoia would be having a dedicated testing department, yes. For the bedroom developer that's making use of siblings :)

    Bad day in Innsmouth. Somebody needed a hug.
     
    megabrobro and hippocoder like this.
  39. Archemicus

    Archemicus

    Joined:
    Jul 22, 2017
    Posts:
    2
    So what happens to the JavaScript developers?
    I work all day on my job as a FrontEnd developer with JavaScript, i don't want to learn a new language to create new game projects...

    And why should i freeze with a version? I will always keep stuck with the same bugs and same characteristics?

    I always hated C, other than on game developing i don't see future for it. I keep seeing new F***ing big technologies developed for JavaScript, where are the C# ones?

    And why choose C# over UnityScript? I hate the people that make S***ty code with JavaScript, but overall i keep thinking JavaScript is better.

    (I know UnityScript is not JavaScript, but it's almost the same... just if they updated it to ES6...)
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity has never used JavaScript though.

    It's not the same language you use, it's just the same name. Sorry to burst that bubble. None of what you said makes any real sense. C# isn't anything like C either.

    There is no relationship at all, and never can be, between real javascript and unityscript. Took me about a day or so to switch from unityscript to C# and I wasn't really trying.

    Just need to prefix your variables / change a few habits. That's it. Really. That's it. This is the single reason nobody understands your panic.
     
  41. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    C# bears little resemblance to C. It's actually a pretty good language, and all you have to do is learn a few syntax differences between it and UnityScript. All of the API calls and such are exactly the same.

    Because you will have no choice if you want to continue using UnityScript.
     
  42. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    They continue to write JavaScript.

    Well, that eliminates you from quite a lot…

    C is not C#. You may find there are quite a few fields which use plain, old C though. Game development has moved on to C++ and C# for the most part, with a truly massive number of scripting solutions, custom or otherwise. C can still be handy for optimisation too, at least in a cross-platform context.

    What do you mean? Do you want a new framework every week?

    UT have already deprecated UnityScript. Blog posts have been made on the subject, documentation has been focused on C# for a long time. They don't want to maintain Boo + UnityScript (which is a variation on the Boo engine) + documentation for them.

    Just because you like something better doesn't mean it actually is better. UT have clearly decided they agree that C# is better, so that's the language now. There are just too many nice things about C# to want to step down to UnityScript anyway.
     
    hippocoder likes this.
  43. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,524
    If they're using JavaScript in Unity then they know they aren't using JavaScript in Unity.

    Version locking is common practice in every project at some point, this isn't really a sore point.

    The fact that it's the most used language by Unity developers is significant in itself considering how viral it is. Aside from that it's quite prolific on basically every platform.

    You seem biased by your personal preference and opinion, and theres nothing wrong with that as long as you understand it's your personal opinion.
     
  44. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Ugh, finally. Time to kill that hambeast of a language.
     
  45. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Um no. It's not even close. UnityScript is far closer to C# then it is to JavaScript.

    Also irrelevant, because none of those new technologies will work in UnityScript.

    Don't use Unity then. Barely a single line of actual JavaScript will work in Unity. Learning UnityScript would be a new language for you.

    The marketers lied to you about Unity and JavaScript. Its never been a viable option to use JavaScript in Unity. Dropping UnityScript support won't change that.
     
    passerbycmc and hippocoder like this.
  46. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,524
    I think people start programming in Unity and use UnityScript because it's weakly typed, then start calling themselves JavaScript developers. Numerous times I've replied to scripting threads where the author uses it and claims he uses JS everywhere else in all these web projects and I'm left confused, wondering how he could possibly think that JS == UnityScript even in the slightest if he really did use JS in some professional manner. Then I realize he is actually clueless and probably just uses Unity/US.

    Or, JavaScript developers that don't actually use Unity - but are thinking about it - see that they're canning "JS" and get all up in arms for no reason.
     
    TaleOf4Gamers, Kiwasi and StarManta like this.
  47. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,532
    This is the part that's confusing me...

    New technologies either for, or dealing with, C# are coming out all the time.

    Just because in the web world JS gets all sorts of frameworks made for it, and you see those, doesn't mean everything else doesn't.

    C# isn't in the web world... or rather, it's not ONLY in the web world.

    In its worlds, technologies come out all the time.
     
  48. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    And technically speaking, its been almost a decade since anything new came out for UnityScript.

    If new technologies is an advantage, then its definitely a plus for C# and a negative for UnityScript.
     
    TaleOf4Gamers likes this.
  49. Bip901

    Bip901

    Joined:
    May 18, 2017
    Posts:
    71
    Fair enough. But you must admit that UnityScript is easier to learn. I learned it in 3 weeks because I was familiar with the JS syntax. Now, a few months later, I can translate most C# scripts I see to UnityScript. UnityScript is similiar to both C# and JavaScript, and that's the reason I chose Unity over Unreal.

    I'm very sad Unity decided to kill UnityScript, but I know I can't really change their decision. Not by whining about it, at least.
    Goodbye, UnityScript. You were a great first-Unity-language-for-starters.
     
    Kiwasi likes this.
  50. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    i really fail the see the issue, C# is better supported and has better docs which in my eyes makes it the more beginner friendly language. For those stating that wanted UnityScript since they work with JS on the web well your JS is not going to be similar at all to UnityScript, and if you already proficient in one language why not learn a other since learning new languages once you know how to program is a pretty easy process.

    Think about it, you will learn more about programming as a whole by learning more languages. When learning a new language it forces you to ask yourself a lot of questions about why a language is designed in a certain way, and what problems certain features were designed to solve.

    I currently use C#, JavaScript, Python and C++ for my job and consider my self to have advanced knowledge in those languages and also know and use Java, Ruby and Obj-C for side projects. I believe that learning all of these languages has made me a better developer and that knowing these languages makes me much more employable.
     
    bigmisterb and Kiwasi like this.
Thread Status:
Not open for further replies.