<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Javascript Version?]]></title><description><![CDATA[<p dir="auto">So, time to start making things in HISE. First question what version of Javascript are we using ECMA 6? 5?</p>
<p dir="auto">Sorry if this is answered elsewhere, I couldn't find it in the documentation, in the forum or over on the JUCE site.</p>
]]></description><link>https://forum.hise.audio/topic/177/javascript-version</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 19:49:36 GMT</lastBuildDate><atom:link href="https://forum.hise.audio/topic/177.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Feb 2017 12:11:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Javascript Version? on Fri, 03 Feb 2017 21:37:53 GMT]]></title><description><![CDATA[<p dir="auto">Actually I am thinking about renaming the script language to something like HiseScript, since there are many language differences to traditional Javascript (<code>reg</code>, <code>namespace</code>, <code>include</code>, <code>inline function</code>, <code>local</code> just to name the most important ones). On the other hand it's a valid superset of Javascript (so almost every Javascript construct should work in the HISE implementation so it's not "Yet Another Script Language".</p>
<p dir="auto">About the classes thing, most encapsulation needs can be satisfied with the namespace concept that David sketched above, however if you are looking for any kind of inheritance or even polymorphism you're out of luck (to be honest, I don't know ECMA 6 well enough to know what's going on there).</p>
<p dir="auto">Could you describe what kind of thing you want to achieve using classes? I am positive there's a solution in the current HISE implementation.</p>
]]></description><link>https://forum.hise.audio/post/935</link><guid isPermaLink="true">https://forum.hise.audio/post/935</guid><dc:creator><![CDATA[Christoph Hart]]></dc:creator><pubDate>Fri, 03 Feb 2017 21:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to Javascript Version? on Fri, 03 Feb 2017 14:31:38 GMT]]></title><description><![CDATA[<p dir="auto">I experimented with a few different ways of doing classes with HISE, there are some posts (probably in the scripting forum) about this. Basically I started with the usual self invoking functions and this worked for simple situations but had problems when used in more complex contexts, it also had problems with private variables, this may work now though. The solution I use now was suggested by Christoph and to me it makes a lot of sense and works really well with HISE's namespace system.</p>
<p dir="auto">So to create a class I would do this</p>
<pre><code>namespace myClass
{
    reg _privateVariable; //Use underscore for variables that should be private
    reg publicVariable;

    inline function createInstanceOfClass(id, someParameter)
    {
        local obj = {};
        
        obj.id = id;
        obj.someParameter = someParameter;
        return obj;
    }

    inline function changeParameter(obj, parameter, value) //Pass in the instance of the object
    {
        obj[parameter] = value;
    }
}
</code></pre>
<p dir="auto">This setup is very efficient because each object doesn't need to contain all of the class functions it is just a standalone object that can make use of the functions within the namespace. It provides all the flexibility of true classes without the overhead.</p>
]]></description><link>https://forum.hise.audio/post/932</link><guid isPermaLink="true">https://forum.hise.audio/post/932</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Fri, 03 Feb 2017 14:31:38 GMT</pubDate></item><item><title><![CDATA[Reply to Javascript Version? on Fri, 03 Feb 2017 14:15:22 GMT]]></title><description><![CDATA[<p dir="auto">Hmm, I sorta guessed this, but I was hoping for (at least some of) ECMA 6, so I can at least have "real" classes.</p>
]]></description><link>https://forum.hise.audio/post/931</link><guid isPermaLink="true">https://forum.hise.audio/post/931</guid><dc:creator><![CDATA[Lindon]]></dc:creator><pubDate>Fri, 03 Feb 2017 14:15:22 GMT</pubDate></item><item><title><![CDATA[Reply to Javascript Version? on Fri, 03 Feb 2017 12:40:33 GMT]]></title><description><![CDATA[<p dir="auto">From what I've gathered through my use of JavaScript in HISE it doesn't seem to be a standard web type implementation but more a pick n mix of the most suitable bits with a lot of additional stuff specifically for HISE - I'm probably not 100% correct about this though.</p>
]]></description><link>https://forum.hise.audio/post/930</link><guid isPermaLink="true">https://forum.hise.audio/post/930</guid><dc:creator><![CDATA[David Healey]]></dc:creator><pubDate>Fri, 03 Feb 2017 12:40:33 GMT</pubDate></item></channel></rss>