Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Where I can find JS(UnityScript) compiler?

Discussion in 'Scripting' started by MikeyJY, Sep 10, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    I need an URL to where I can download the legacy JS compiler for unity(Please don't send github url because I can't access it)
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Did not even know there was one. I would only just google for it. Keep in mind that if the one on github fails for you, it might be because it is no longer supported.
     
  3. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Is there even a compiler? UnityScript may have been interpreted at runtime as far as I know.
     
  4. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    As someone who wrote his first "Hello world!"(first ever code) in java I should prefer c#(and I prefer it), but I'm feeling bad for js, don't know why! And even if at my profile it sais "Joined Mar 2, 2018", I first used unity in 2015, I think Unity 5 and at that time JS wasn't under "Create - Legacy - UnityScript"(now it isn't even here) it was under "Create - Script - JavaScript", near cscript, and it was supported.
     
    Last edited: Sep 11, 2020
  5. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Anyway I was childish, at 14 years(in 2015, now I am 19) I wanted to make a game and I installed unity even if my greatest coding achievement was to create a simple console program (a simple calculator) with Eclipse IDE. I was a fan of The Forest and that's why I chosen Unity, and I wanted to create a survival and my first project was 3D. I really thought that I can handle survival mechanics with my "vast" experience of console calculator.
     
  6. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    Haha - no shame in that! When I was around that age I tried to make Chess in a Starcraft custom game. My ultra-naïve implementation plan was to enumerate every possible board state and every possible move you could make from each board state!
     
    MikeyJY likes this.
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    Let me jump in and agree, the stuff we did as kids was amazing... that we had so much patience! I see kids repeating it now with Minecraft and other "programmable" games. Nutty and awesome!

    Anyway, just want to point out that Java and Javascript are not at all the same thing, but also that Unityscript and Javascript are also not the same thing.

    Finally, let me invite you to throw yourself into C# because honestly, if you can do JS or Java, you can easily wrap your head around C# with all the goodness of a more modern language. It really should not be hard for you. There's even websites out there that can convert 95% of your javascript into C# for you, if your old scripts are worth upgrading that way.

    Personally, I think old code has relatively little value: I know how to do something better and better every time I take a whack at it, as my understanding of the problem (and indeed the problem itself) has changed.
     
    angrypenguin likes this.
  8. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    I know that's why I said that I should prefer c# because is similar to java

    I'm already using c#, because is the only one for unity right know. I was asking about js because was there when I started with unity and I just want to remember my "childhood" to make my game contains just 1 js. I mean every post since 2018 by me was about c#

    I chosen java to learn first because my dad told me that minecraft, my favorite game at that time was made in java, and I thought that I can make a minecraft in java, of course I didn't know about graphics and how to use java with OpenGL.

    And even if I had too ambigious dreams for my knowledge, I don't regret anything. I mean even Bill gates started with "Hello World!"(probably).
     
    Last edited: Nov 15, 2020
  9. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,762
    If you just want to remember the glory of Javascript, hie thee to a nice thin lightweight framework such as http://phaser.io/ and take a look around... nothing to even install, just tinker right on their site, see your results instantly in the browser. If you want to install, that works easily too. It's a pretty smokin' nice simple game API, but complex enough you can do anything with it really. There are 3D versions of such canvas libraries too.

    I am not qualified to diagnose myself but I think many software engineers show behaviors that could place them on the spectrum, but I am no expert. I don't exempt myself from that, but I try to direct my energies fruitfully.

    Goodness no, I love deleting code! Deleting code is the surest way to get rid of bugs and old crappy design, of which I do a lot of. In fact, it is allegedly said by an old C guru, but who really knows:

    https://skeptics.stackexchange.com/...-my-most-productive-days-was-throwing-away-10

    Code goes bad, some faster than others. Code gets rotten, soggy, heavy, dirty, worn around the edges, nasty and dangerous to work with... always refreshing to purge the slate and start afresh. Think of yourself as a code gardener: you have to sometimes plow last years crop under in order to make room for new crop.

    In fact, I'm known for my well worn-down delete keys. There's almost no paint left on the tops of them!
     
    Bunny83 and Munchy2007 like this.
  10. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,731
    I couldn't agree more!
     
  11. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    760
  12. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,530
    Just to clear up some things here. UnityScript was a compiled .NET language. The UnityScript compiler was build on top of the Boo compiler (which is also a .NET language with a python-like syntax). That's also why Unity used to support those 3 languages: C#, Boo and UnityScript. Unity has first deprecated and later completely removed the UnityScript and Boo compiler from the editor because the differences in languages caused a maintenance hell. Also as C# has grown in functionality, UnityScript was slowly falling behind and would require active development to keep it somewhat up to date.

    They finally made the decision to remove UnityScript for all those reasons and because the majority of prpjects didn't use any or very little UnityScript files in their projects (statistics rules!). That said they actually open sourced the UnityScript compiler so people could use the language for whatever they want. Please keep in mind that this repository is actually a Boo .NET project. It needs to be compiled with the Boo compiler as almost the complete compiler is written in Boo. However this only give you the compiler as a bunch of DLL files. This is NOT something you can simply plug into Unity and magically UnityScript scripts are supported again. They opensourced it so the language can be used in other projects.

    While it might be possible to actually create a standalone UnityScript compiler from this source and maybe you can automatically compile unityscript scripts using Unity's relatively new scripted importers, the behaviour will never be the same as it was when the language was a part of the editor. If you wanted to achieve something like that you probably don't really see how huge this goal is.

    I've said this a dozen times while UnityScript was still a part of Unity: While UnityScript seems to be simpler, more forgiving and to require less code on the surface, in the end it was the exact opposite in all 3 cases. UnityScript has so many special cases or special behaviour in special cases that you actually had to learn in order to use it "properly". The "forgivingness" of the compiler was just on the surface. Bad code was still bad code and UnityScript made it easy to write horrible bad and inefficient code without noticing it. The reason for this is essentially covered by my first point. UnityScript had a lot more cryptic error messages. Yes, very simple UnityScript scripts tend to be shorter because you didn't have the explicit class overhead. Though as soon as you actually implement OOP and inheritance, the same boilerplate comes back and is actually more code to write. In order to provide similar features to C# there was custom syntax to create properties which was a lot less clean compared to C#. At the end of the day UnityScript was lacking many features that C# had or made them more complicated.

    UnityScript was mainly created to attract web developers by using the name "Javascript". However UnityScript was just a language which has a similar syntax to Javascript but couldn't be further away from actual Javascript. US is still a .NET language and just like C# is compiled to the same CIL code.

    If you want to dwell in nostalgia I would simply recommend to install an older version of Unity. I started programming with Pascal in 1995 and I still have most of my programs. I also still carry the turbo pascal and borland pascal compilers around from PC to PC (all this is well under 100MB -.-). Nowadays we would need dosbox to actually run the IDE or compile any of the code. However I haven't really done anything new in this domain. I still carry some old Delphi application that is still in use, however working on that code base is quite a painful experience for several reasons, mainly because compared to C# and some other more modern languages the syntax looks and feels alien to me now. While I do miss the "good old days" quite often, I wouldn't want to go back. Since we essentially exterminated CRT monitors, dos graphics have lost their charm -.-. No modern LCD, TFT, ... would come even close to the contrast of a low resolution CRT screen :D
     
  13. malcomjarr

    malcomjarr

    Joined:
    Nov 18, 2020
    Posts:
    7
    A computer program is usually written in high level language described as a source code. The difference between an interpreter and compiler is the point at which a source code is actually executed. This means that when convert source code into machine code , we use either a compiler or an interpreter. So generally categorizing computer languages by "compiled" or "interpreted" doesn't make much sense. Now a days, interpreting Vs. compiling is a trade-off, with time spent compiling often being rewarded by better runtime performance , but an interpretative environment giving more opportunities for interaction .