/supcode

A conceptual programming language created by Sup#2.0

Primary LanguageMarkdown

supcode

supcode title card

A modern, high-level, feature-rich general-purpose programming language.

site \ walkthrough \ docs \ reddit \ Nova


glimpse into supcode


Features

  • Intuitive keyword-focused syntax
  • Object-oriented and dynamically typed
  • kebab-case in identifiers for maximum readability
  • Clean and easy modularisation and path resolution
  • Flexible with configurations and flavours
  • Versatile with extensions and frameworks
  • Purely conceptual – you can’t write a single bug if the code doesn’t run!

Explore

Tip

For the best first viewing experience, check out the supcode site!

Want to see more of supcode? We’ve got a huge array of specimens.

Looking to learn the language? The supcoda is a full walkthrough.

Instant question? There’s a good chance it’s answered in FAQ.

another glimpse into supcode

Info

supcode 5.0

official name supcode
format text-based
level high-level
execution interpreted
paradigm imperative, object-oriented, event-driven
purpose general-purpose
syntax human-friendly – readable, intuitive, keyword-focused
type dynamic
indentation significant (pre-6.0)
insignificant (post-6.0)
platform any
based on Scratch, Python
inspired by Wikitext Markup, Swift, C#, HTML
filename extensions .sc, .sc6 .sc5, .scx
other extensions .scd, .scp, .scv, .scl, .scs, .scg
main flavour Utinax One
other flavours Veritinax One, Resinax 1.6
initial release September 2021
founder Sup#2.0
developer 2.0 Studios (2.0 Studios LLC)
IDEs supcode Studio, supcode Studio Strium
latest release 5.7 (July 2023)
6.0 (upcoming)

Contributing

Feedback, thoughts and criticism are absolutely welcome! Just drop something in issues or discussions.

Roadmap

  • site
  • supcoda
  • Learn supcode in Y minutes
  • PrismJS syntax highlighter

About

Made with love by Sup#2.0 (@Sup2Point0).

On ? September 2021, I sent a code file written in a hypothetical programming language to my friend, just as a joke. What d’y’know, a joke develops until it becomes reality, and supcode was born. Development subsequently kicked off, with 3 major revisions of the language, before we reached stability with supcode 4.0.

supcode draws upon each and every coding language I’ve worked with – primarily Scratch, Python and Wikitext Markup. Its original intention was to act as a bridge between the block-based syntax of Scratch and text-based syntax of real code, although the language has deteriorated developed too far for this vision to remain accurate. Above all, it aims to be fun, unique and dynamic.

I’ve placed all this work under the MIT license, but in the unlikely case that anyone would like to use any of it, credit would be appreciated.

Enjoy!


Specimens

supcode 6.0

Note

supcode 6.0 is currently under development.

<sup ver="6" sty="utinax-vis" ind=3>
\\
DISCLAIMER –
This code is only a peek at what supcode can do.
It is not by any means functional, optimised or perfect.
Enjoy ^v^
\\

<sec 'structs'>
create struct 'profile' {
   \\
      Represents a user profile.
   \\

   evolve action create self(ctx) [
     | int 'id'
     | str 'user', 'name'
     | str, list(str) 'alts' = none
     | list(str) 'langs' = list()
     | list(str) 'apts' = list()
     | (par)s 'pars'
   ] {
      \\
         Creates a new profile.
      \\

      auto set id, name, alt-name, langs, apts

      set self.'render-keywords' = dict(
         "id" = "User ID",
         "name" = "Username",
         "alts" = "Alternative Usernames",
         "langs" = "Programming Languages",
         "apts" = "Aptitudes",
      )

      loop for key, val in pars {
         set self.(shard(key)) = val
      }
   }

   create func self.render-text() to str {
      set 'text' = "Profile[" + "\n"

      loop for 'var' in self._vars_ {
         if var in self.render-keywords {
            alt text + "`render-keywords # var`: "
         } else {
            alt text + str(var) + ": "
         }

         alt text + { if var is iterable then {
            str.join(
               { for each in var out str(each) }
            ) [sep = ", "]
         } else str(var) }
      }

      out text
   }
}
</sec>

<sec "core">
evolve sys.run(ctx) [(par)s]
{
   set 'sup' = profile() [
      | id = 2.0
      | name = "Sup#2.0"
      | alt-name = "Sup2point0"
      | langs = "supcode", "Scratch", "Python", "C#", "HTML", "CSS", "JavaScript",
      | apts = (
         "creating", "designing", "coding", "procrastinating",
      )
   ]

   sys.out(sup.render-text())
   sys.in()
   sys.quit()
}
</sec>

\ how’d you like that?
</sup>

supcode 5.7

\ supcode 5.7

create struct 'SoupMachine' {
  evolve func self.create(ctx) [
    | num 'cost'
    | str 'name' = none
    | (str)s 'flavours' = ()
  ] {
    set self.'cost' = cost
    set self.'name' = { if name then name else ctx.shard.str }
    set self.'flavours' = { loop for each in flavours || case(each)[lower] }
  }
  
  define self.purchase() [
    | source
    | int 'count' = 1
    | pool[self.flavours] 'flavour' = none
  ] {
    if count < 1 {
      evoke "Can’t give that many bowls of soup!"
    }
    
    if not flavour {
      set 'flavour' = random(self.flavours)[option]
    }
    
    alt source - self.cost * count
    func.out("Here’s some flavour` soup!")
  }
}

set 'credits' = 200
set 'soupy' = SoupMachine() [
  | cost = 20
  | flavours = "tomato", "mushroom", "potato"
]

sys.out(soupy.purchase(credits, 1, "mushroom"))