Click here to Skip to main content
13,635,085 members
Click here to Skip to main content

Tagged as

Stats

43.3K views
98 downloads
21 bookmarked
Posted 27 Sep 2012
Licenced MIT

ObjectScript: A new programming language

, 9 Oct 2012
The ObjectScript is a new programing language that mixes benefits of JavaScript, Lua, and PHP. The ObjectScript has syntax from JavaScript, multiple results from Lua, OOP from PHP and much more.
OS
examples-os
add_user_module.os
bind.os
core.os
run_os_prog.os
test.os
proj.win32
add_user_module
os
osbind
profile_benchmark
scripts
test_fannkuch.os
run_os_prog
stack_usage
source
bin
os.exe
add_user_module.os
bind.os
core.os
run_os_prog.os
test.os
Makefile
test_fannkuch.os
unitpoint-objectscript-86f30d7
.gitignore
bin
.gitignore
examples-os
add_user_module.os
bind.os
core.os
run_os_prog.os
test.os
proj.win32
.gitignore
add_user_module
.gitignore
os
.gitignore
test_fannkuch.osc
test_fannkuch.osd
osbind
.gitignore
profile_benchmark
.gitignore
scripts
test_fannkuch.os
run_os_prog
.gitignore
stack_usage
.gitignore
source
.gitignore
.gitignore
.gitignore
os.exe
add_user_module.os
bind.os
core.os
run_os_prog.os
test.os
.gitignore
.gitignore
.gitignore
test_fannkuch.osc
test_fannkuch.osd
.gitignore
.gitignore
test_fannkuch.os
.gitignore
.gitignore
.gitignore
[FILE] ../../examples-os/run_os_prog.os
[1] print("10 * (3+2) = ", 10 * (3+2))

begin function
  begin locals, total 2
    0 _E
    1 _G
  end locals
  begin call method
    get local var _E (0 0)
    begin params 3
      push const string "print"
      ,
      push const string "10 * (3+2) = "
      ,
      push const number 50
    end params ret values 3
  end call method ret values 0


[3] bar = {firsname="James", lastname="Bond"}

  begin set env var
    begin object 2
      begin set by name
        push const string "James"
      end set by name: [firsname]
      ,
      begin set by name
        push const string "Bond"
      end set by name: [lastname]
    end object
  end set env var bar


[4] bar.profession = "actor"

  begin set property
    push const string "actor"
    get env var auto create bar
    push const string "profession"
  end set property ret values 0


[5] print bar

  begin call method
    get local var _E (0 0)
    begin params 2
      push const string "print"
      ,
      get env var bar
    end params ret values 2
  end call method ret values 0


[7] print(concat(5, " big differences"))

  begin call method
    get local var _E (0 0)
    begin params 2
      push const string "print"
      ,
      begin call method
        get local var _E (0 0)
        begin params 3
          push const string "concat"
          ,
          push const number 5
          ,
          push const string " big differences"
        end params ret values 3
      end call method ret values 1
    end params ret values 2
  end call method ret values 0

  begin code list
    begin return
      get local var _E (0 0)
    end return values 1
  end code list ret values 0
end function

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

unitpoint
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.180712.1 | Last Updated 9 Oct 2012
Article Copyright 2012 by unitpoint
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid