GithubHelp home page GithubHelp logo

unitpoint / objectscript Goto Github PK

View Code? Open in Web Editor NEW
70.0 70.0 19.0 49.51 MB

ObjectScript, OS for short, is a new programming language. It's free, cross-platform, lightweight, embeddable and open-source. It combines the benefits of multiple languages, including: JavaScript, Lua, Ruby, Python and PHP. OS features the syntax of Javascripts, the "multiple results" feature from lua, syntactic shugar from Ruby as well as magic methods from PHP and Ruby - and even more!

Home Page: http://objectscript.org

License: Other

Shell 0.02% C++ 25.94% C 55.76% Makefile 0.03% CSS 0.09% XSLT 0.13% Perl 0.04% Vim Script 0.06% CMake 0.92% HTML 16.64% Inno Setup 0.02% Groff 0.04% Smarty 0.05% DIGITAL Command Language 0.27% Batchfile 0.01%

objectscript's Introduction

ObjectScript

ObjectScript, OS for short, is a new programming language. It's free, cross-platform, lightweight, embeddable and open-source. It combines the benefits of multiple languages, including: JavaScript, Lua, Ruby, Python and PHP. OS features the syntax of Javascripts, the "multiple results" feature from lua, syntactic shugar from Ruby as well as magic methods from PHP and Ruby - and even more!

The ObjectScript is universal scripting language, there are no compromises any more.

Compile and Install os-fcgi and os

Run the following commands after you have cloned this repository:

mkdir build && cd build
cmake ..
make
make install

If you are on an operating system like Debian or Ubuntu, you can then start os-fcgi by typing:

service os-fcgi start

Installing the Database layer

During the configuration, you may notice that a library named SoCi could not be found. This is the database abstraction which is used by ObjectScript's ext-odbo module. You can build SoCi alongside OS by using the following CMake command instead of the one given above:

cmake .. -DBUILD_SOCI=ON

After that, you should be good to go.

Dependencies

If you are on an operating system like Debian or Ubuntu, you can install dependencies by typing:

aptitude install libpcre3-dev
aptitude install libmysqlclient-dev
aptitude install libcurl4-openssl-dev

Special note for Apple Mac OS X builds

Depending on how you have installed MySQL on your system, you may run into this error by running os or os-fcgi from the build directory or after you have installed it:

dyld: Library not loaded: libmysqlclient.18.dylib
  Referenced from: /usr/local/bin/os
  Reason: image not found

Or similar. To fix this, do as follows:

# Navigate back into your build folder if you have previously left it
cd build
../contrib/change_install_name.sh

This will update all the binaries within your build folder and make them find the library - hopefuly.

Using ObjectScript in your app

After installing ObjectScript, you also will get the required headers into your system to utilize ObjectScript in your app. This is especially useful to let the user do something within your app. Here is an example:

app.cpp:

#include <objectscript.h>

using namespace ObjectScript;

int main(int argc, char** argv) {
	OS* os = OS::create();

	// simulate calling "print()" with given argv
	os->getGlobal("print");
	os->newArray(argc);
	for(int i=0; i<argc; i++) {
		os->pushString(argv[i]);
		os->addProperty(-2);
	}
	os->callF(1);
}

Now, compile it just like this:

g++ app.cpp -o app -lobjectscript

To do so on Windows, copy the resulting libobjectscript.lib and src/objectscript.h to your project, and compile as:

cl app.cpp libobjectscript.lib /I. /Fe:app

The library and headers are installed globally into your installation path's include folder.

Nginx config example (for os-fcgi)

server {
	listen			80;
	server_name		mydomain.com www.mydomain.com;
	root			/home/myuser/mydomain.com/www;
	error_log		/var/log/nginx/error.mydomain.com.log;
	access_log		off;
	location ~ /\.ht {
		deny all;
	}
	location ~ /\.git {
		deny all;
	}
	location / {
		try_files $uri $uri/ /index.osh /index.os;
	}
	location ~* \.(jpg|jpeg|png|gif|swf|flv|mp4|mov|avi|wmv|m4v|mkv|ico|js|css|txt)$ {
		access_log off;
		expires 7d;
	}
	charset	utf-8;
	location ~ ^.+\.osh? {
		fastcgi_split_path_info	^(.+?\.osh?)(.*)$;
		fastcgi_pass	127.0.0.1:9000;
		fastcgi_index	index.osh;
		include fastcgi_params;
		fastcgi_intercept_errors	on;
		fastcgi_ignore_client_abort	on;
		fastcgi_read_timeout	360;
	}
}

Apache config example (for os-fcgi)

<VirtualHost mydomain.com:80>
	ServerAdmin [email protected]
	DocumentRoot "/home/myuser/mydomain.com/www"
	ServerName mydomain.com

	FastCgiExternalServer "/home/myuser/mydomain.com/www" -host 127.0.0.1:9000

	<Directory "/home/myuser/mydomain.com/www">
		# SetHandler fastcgi-script
		AddHandler fastcgi-script .osh
		AddHandler fastcgi-script .os
		Options Indexes FollowSymLinks MultiViews ExecCGI
		AllowOverride all
		Order Deny,Allow
		Deny from all
		Allow from 127.0.0.1
	</Directory>
</VirtualHost>

Resources

##Contacts

Please feel free to contact me at anytime, my email is [email protected], skype: egolovin

P.S. old files of this repo have been moved to https://github.com/unitpoint/objectscript-old

objectscript's People

Contributors

aperezdc avatar hoopoepg avatar igor-bogomolov avatar mvpetrov avatar unitpoint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectscript's Issues

D-like форматированние чисел

У D числа можно разбивать знаком нижнего подчёркивания:

var num1 = 12000543; // плохо читается
var num2 = 12_000_543; // красота

OS::setGlobal(FuncDef *) ?

I was trying to register many OS::FuncDef's at once, only to find out, that was only possible on modules? At least it seems like it. Is there a way to make this

    OS::FuncDef func1 = {OS_TEXT("testFunc1"), testFunc1};
    OS::FuncDef func2 = {OS_TEXT("testFunc2"), testFunc2};
    OS::FuncDef func3 = {OS_TEXT("testFunc3"), testFunc3};
    os->setGlobal(func1);
    os->setGlobal(func2);
    os->setGlobal(func3);

...into something not-so-verbose, like just registering a full array? When I used OS::setFuncs(...) the functions were not available in my code.

Kind regards, Ingwie.

C++ embedding questions

Hey.

so, I just had to realize that the scripting language that I originalyl wanted to use for my project, has quite some issues. So I need to switch to ObjectScript now. And this brings questions:

  1. How thread-safe is ObjectScript?
  2. Can I compile/run multiple script snippets? Currently, the order would be something like: string, string, string, file, string, string. in my previous used language, ph7, the VM would reset upon each new loaded snippet.
  3. What's the API to insert variables and the like into the scripting eingine?
  4. Can I define getter/setter functions for some native variables?

My project is here: http://github.com/IngwiePhoenix/IceTea

Kind regards, Ingwie

Разделить objectscript.cpp на модули и ядро

Вынести init_Module() и init_Class(), токенайзер и т.д. Было бы очень здорово. Чтение кода и так достаточно удобное, но вынесение:

  1. упростило бы чтение и поиск;
  2. задало бы правило нейминга модулей.

Вообще, замечательнейший язык! Все три моих любимых ЯП в одном: луа, пышечка и JS. :)

И очень удобный синтаксис за счёт своей гибкости. На мой взгляд, встраиваемый язык и должен быть гибким.

P.S. *Class и *Module различны только тем, что *Class это часть языка. Имхо, градация излишня. Одна сущность *Module это гораздо круче. :)

Need help for an implementation

Hey!

I want to create a build tool based off ObjectScript. to realize it, I want to use a syntax similar to this:

target("foo") = {
    type: "static_lib",
    input: {
        files("src/*.c")
    }
}

In C++, i can do similar with operator overloading. But ObjectScript should understand that as an actual object, if I am not mistaken. But how will the parser react? In C++, I am using a proxy function. That actually looks like this:

#include <iostream>
using namespace std;
typedef struct TargetData
{
    string tag;
} * TargetData_t;
class TargetHandle {
    public:
        TargetHandle(string str) {
            cout << "Target: " << str << endl;
        }
        void operator=(TargetData TG) {
            cout << "Handling: " << TG.tag << endl;
        }
};
TargetHandle target(string str) {
    return *(new TargetHandle(str));
}
int main() {
    TargetData td = { "Foo" };
    target("libfoo.a") = td;
    return 0;
}

How would I go and implement similar syntax within ObjectScript?

Kind regards, Ingwie.

Convenience types and methods

Hey.

When working with objects in a C++ function, it turns out that its quite hard to avoid boilerplate code.

I would like to make a few suggestions:

  • Offer wrapper types to access values in objects/arrays. Example: OS::Object obj = os->toObj(...); std::string str = obj["foo"];
  • Offer convenience methods to convert arrays into lists: OS::List ls = os->toList(...); std::string str = ls[0];

I am mainly asking, since I am trying to write a converter between (VarObject)[https://github.com/eJimLee/VarObject] and an OS Object.

I just can't seem to find a "good" way of doing it. So having a method provided by the internals would be very nice. Do you think this could be implemented?

Kind regards, Ingwie.

$ operator example!

Hey!

I just got a little idea...

I will be using ObjectScript to pre-build a rather complex aplication, and therefore I will - obviously - be running shell commands, compilers etc. So I had the following idea:

out = $("gcc -o ? ?", outputName, objects);

$, being a shorthand for system() or similar. Since OS can return multiple results, why not return the exit code and the command output?

Just wanted to know what you'd think. ^^

Alternatively, how would I implement this on my own, if I really wanted to?

Kind regards, Ingwie.

Compile error

Вот что мы имеем в g++ 4.6.3 по команде g++ objectscript.cpp без параметров. ОС Ubuntu linux 12.04.1 LTS

In file included from objectscript.cpp:1:0:
objectscript.h:420:40: ошибка: «__int32» не был декларирован
objectscript.h:421:40: ошибка: «__int64» не был декларирован
objectscript.h:421:21: ошибка: «static char* ObjectScript::OS::Utils::numToStr(char*, int)» cannot be overloaded
objectscript.h:420:21: ошибка: with «static char* ObjectScript::OS::Utils::numToStr(char*, int)»
objectscript.h:656:29: ошибка: «__int64» не был декларирован
objectscript.h:657:34: ошибка: «__int64» не был декларирован
objectscript.h:737:13: ошибка: «__int32» не является именем типа
objectscript.h:738:13: ошибка: «__int32» не является именем типа
objectscript.h:740:13: ошибка: «__int64» не является именем типа
objectscript.h:741:13: ошибка: «__int64» не является именем типа
In file included from objectscript.cpp:1:0:
objectscript.h:1340:19: ошибка: поле «__int32» имеет неполный тип
objectscript.h:1341:19: ошибка: поле «__int64» имеет неполный тип
objectscript.h:2436:4: ошибка: expected «;» at end of member declaration
objectscript.h:2436:11: ошибка: «rand_state» не является именем типа
objectscript.h:2437:4: ошибка: expected «;» at end of member declaration
objectscript.h:2437:4: ошибка: декларация «unsigned int ObjectScript::OS::Core::__int32»
objectscript.h:2436:4: ошибка: conflicts with previous declaration «unsigned int ObjectScript::OS::Core::__int32»
objectscript.h:2437:11: ошибка: «rand_seed» не является именем типа
objectscript.h:2438:4: ошибка: expected «;» at end of member declaration
objectscript.h:2438:4: ошибка: декларация «unsigned int ObjectScript::OS::Core::__int32»
objectscript.h:2436:4: ошибка: conflicts with previous declaration «unsigned int ObjectScript::OS::Core::__int32»
objectscript.h:2438:13: ошибка: ISO C++ запрещает декларации «rand_next» без типа [-fpermissive]
objectscript.h:2444:31: ошибка: expected «,» or «...» before «seed»
objectscript.h:2532:20: ошибка: «__int32» is not a type
objectscript.h:2533:20: ошибка: «__int64» не был декларирован
objectscript.h:2533:9: ошибка: «void ObjectScript::OS::Core::pushNumber(int)» cannot be overloaded
objectscript.h:2532:9: ошибка: with «void ObjectScript::OS::Core::pushNumber(int)»
objectscript.h:2851:19: ошибка: «__int32» не был декларирован
objectscript.h:2852:19: ошибка: «__int64» не был декларирован
objectscript.h:2852:8: ошибка: «void ObjectScript::OS::pushNumber(int)» cannot be overloaded
objectscript.h:2851:8: ошибка: with «void ObjectScript::OS::pushNumber(int)»
objectscript.cpp: В функции «int OS_VSNPRINTF(char*, size_t, const char*, va_list)»:
objectscript.cpp:21:64: ошибка: нет декларации «vsnprintf_s» в этой области видимости
objectscript.cpp: В функции «short unsigned int toLittleEndianByteOrder(short unsigned int)»:
objectscript.cpp:76:5: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:76:5: ошибка: expected primary-expression before «)» token
objectscript.cpp:76:5: ошибка: expected «)» before string constant
objectscript.cpp:79:2: ошибка: expected «)» before «unsigned»
objectscript.cpp:79:10: ошибка: expected «)» before «;» token
objectscript.cpp:80:14: ошибка: нет декларации «r» в этой области видимости
objectscript.cpp: В функции «short int toLittleEndianByteOrder(short int)»:
objectscript.cpp:88:5: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:88:5: ошибка: expected primary-expression before «)» token
objectscript.cpp:88:5: ошибка: expected «)» before string constant
objectscript.cpp:91:2: ошибка: expected «)» before «short»
objectscript.cpp:91:12: ошибка: expected «)» before «;» token
objectscript.cpp:92:14: ошибка: нет декларации «r» в этой области видимости
objectscript.cpp: At global scope:
objectscript.cpp:97:15: ошибка: «__int32» не является именем типа
objectscript.cpp:111:15: ошибка: «__int64» не является именем типа
objectscript.cpp: В функции «float toLittleEndianByteOrder(float)»:
objectscript.cpp:132:5: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:132:5: ошибка: expected primary-expression before «)» token
objectscript.cpp:132:5: ошибка: expected «)» before string constant
objectscript.cpp:135:2: ошибка: expected «)» before «float»
objectscript.cpp:135:9: ошибка: expected «)» before «;» token
objectscript.cpp:136:14: ошибка: нет декларации «r» в этой области видимости
objectscript.cpp: В функции «double toLittleEndianByteOrder(double)»:
objectscript.cpp:146:5: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:146:5: ошибка: expected primary-expression before «)» token
objectscript.cpp:146:5: ошибка: expected «)» before string constant
objectscript.cpp:149:2: ошибка: expected «)» before «double»
objectscript.cpp:149:10: ошибка: expected «)» before «;» token
objectscript.cpp:150:14: ошибка: нет декларации «r» в этой области видимости
objectscript.cpp: At global scope:
objectscript.cpp:163:14: ошибка: «__int32» не является именем типа
objectscript.cpp:164:68: ошибка: нет декларации «nan_data» в этой области видимости
objectscript.cpp: In static member function «static bool ObjectScript::OS::Utils::parseFloat(const char*&, double&)»:
objectscript.cpp:331:6: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:331:15: ошибка: expected «;» before «spec_val»
objectscript.cpp:334:7: ошибка: нет декларации «spec_val» в этой области видимости
objectscript.cpp:349:61: ошибка: нет декларации «spec_val» в этой области видимости
objectscript.cpp: At global scope:
objectscript.cpp:401:46: ошибка: «__int32» не был декларирован
objectscript.cpp:407:46: ошибка: «__int64» не был декларирован
objectscript.cpp:407:11: ошибка: redefinition of «static char* ObjectScript::OS::Utils::numToStr(char*, int)»
objectscript.cpp:401:11: ошибка: «static char* ObjectScript::OS::Utils::numToStr(char*, int)» previously defined here
objectscript.cpp: В функции-члене «int ObjectScript::OS::Core::Compiler::cacheString(ObjectScript::OS::Core::Table*, ObjectScript::OS::Vector<ObjectScript::OS::Core::String>&, const ObjectScript::OS::Core::String&)»:
objectscript.cpp:2400:42: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:2400:42: замечание: candidates are:
objectscript.h:1344:5: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.h:1344:5: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.h:1343:5: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.h:1342:5: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.h:1339:5: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.cpp: В функции-члене «int ObjectScript::OS::Core::Compiler::cacheNumber(double)»:
objectscript.cpp:2426:47: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:2426:47: замечание: candidates are:
objectscript.h:1344:5: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.h:1344:5: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.h:1343:5: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.h:1342:5: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.h:1339:5: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.h: В функции-члене «virtual void ObjectScript::OS::Core::StreamWriter::writeInt32(int)»:
objectscript.h:2436:4: ошибка: некорректное использование нестатического элемента «ObjectScript::OS::Core::__int32»
objectscript.cpp:7762:2: ошибка: в этом месте
objectscript.cpp:7762:11: ошибка: expected «;» before «le_value»
objectscript.cpp:7763:14: ошибка: нет декларации «le_value» в этой области видимости
objectscript.h: В функции-члене «virtual void ObjectScript::OS::Core::StreamWriter::writeInt32AtPos(int, int)»:
objectscript.h:2436:4: ошибка: некорректное использование нестатического элемента «ObjectScript::OS::Core::__int32»
objectscript.cpp:7769:2: ошибка: в этом месте
objectscript.cpp:7769:11: ошибка: expected «;» before «le_value»
objectscript.cpp:7770:19: ошибка: нет декларации «le_value» в этой области видимости
objectscript.cpp: At global scope:
objectscript.cpp:7773:41: ошибка: переменная или поле «writeInt64» объявлено void
objectscript.h:618:9: ошибка: «class ObjectScript::OS::Core» is protected
objectscript.cpp:7773:41: ошибка: в данном контексте
objectscript.cpp:7773:41: ошибка: нет декларации «__int64» в этой области видимости
objectscript.cpp:7779:46: ошибка: переменная или поле «writeInt64AtPos» объявлено void
objectscript.h:618:9: ошибка: «class ObjectScript::OS::Core» is protected
objectscript.cpp:7779:46: ошибка: в данном контексте
objectscript.cpp:7779:46: ошибка: нет декларации «__int64» в этой области видимости
objectscript.cpp:7779:62: ошибка: expected primary-expression before «int»
objectscript.cpp:7996:1: ошибка: «__int32» не является именем типа
objectscript.cpp:8003:1: ошибка: «__int32» не является именем типа
objectscript.cpp:8010:1: ошибка: «__int64» не является именем типа
objectscript.cpp:8017:1: ошибка: «__int64» не является именем типа
objectscript.h: В функции-члене «int ObjectScript::OS::Core::PropertyIndex::getHash() const»:
objectscript.h:2436:4: ошибка: некорректное использование нестатического элемента «ObjectScript::OS::Core::__int32»
objectscript.cpp:8335:6: ошибка: в этом месте
objectscript.cpp:8335:6: ошибка: expected primary-expression before «)» token
objectscript.cpp:8335:6: ошибка: expected «)» before string constant
objectscript.cpp:8338:3: ошибка: expected «)» before «break»
objectscript.cpp:8338:8: ошибка: expected «)» before «;» token
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::sortTable(ObjectScript::OS::Core::Table*, int (*)(ObjectScript::OS*, const void*, const void*, void*), void*, bool)»:
objectscript.cpp:8785:25: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:8785:25: замечание: candidates are:
objectscript.h:1344:5: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.h:1344:5: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.h:1343:5: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.h:1342:5: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.h:1339:5: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.cpp: At global scope:
objectscript.cpp:9086:23: ошибка: expected constructor, destructor, or type conversion before «(» token
objectscript.cpp:9092:23: ошибка: expected constructor, destructor, or type conversion before «(» token
objectscript.cpp: In constructor «ObjectScript::OS::Core::ValueRetained::ValueRetained(int)»:
objectscript.cpp:9202:59: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:9202:59: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.cpp: In constructor «ObjectScript::OS::Core::Core(ObjectScript::OS*)»:
objectscript.cpp:10651:12: ошибка: нет декларации «rand_state» в этой области видимости
objectscript.cpp:10653:2: ошибка: нет декларации «rand_seed» в этой области видимости
objectscript.cpp: At global scope:
objectscript.cpp:12299:27: ошибка: переменная или поле «pushNumber» объявлено void
objectscript.h:618:9: ошибка: «class ObjectScript::OS::Core» is protected
objectscript.cpp:12299:27: ошибка: в данном контексте
objectscript.cpp:12299:27: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:12304:27: ошибка: переменная или поле «pushNumber» объявлено void
objectscript.h:618:9: ошибка: «class ObjectScript::OS::Core» is protected
objectscript.cpp:12304:27: ошибка: в данном контексте
objectscript.cpp:12304:27: ошибка: нет декларации «__int64» в этой области видимости
objectscript.cpp:13465:21: ошибка: переменная или поле «pushNumber» объявлено void
objectscript.cpp:13465:21: ошибка: нет декларации «__int32» в этой области видимости
objectscript.cpp:13470:21: ошибка: переменная или поле «pushNumber» объявлено void
objectscript.cpp:13470:21: ошибка: нет декларации «__int64» в этой области видимости
objectscript.cpp: В функции-члене «void ObjectScript::OS::addProperty()»:
objectscript.cpp:13920:50: ошибка: преобразование из «int» в «ObjectScript::OS::Core::Value» неоднозначно
objectscript.cpp:13920:50: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.cpp:13442:6: ошибка:   initializing argument 1 of «void ObjectScript::OS::Core::insertValue(ObjectScript::OS::Core::Value, int)»
objectscript.cpp:13924:86: ошибка: преобразование из «int» в «ObjectScript::OS::Core::Value» неоднозначно
objectscript.cpp:13924:86: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.cpp:13442:6: ошибка:   initializing argument 1 of «void ObjectScript::OS::Core::insertValue(ObjectScript::OS::Core::Value, int)»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::opObjectSetByAutoIndex()»:
objectscript.cpp:14484:50: ошибка: преобразование из «int» в «ObjectScript::OS::Core::Value» неоднозначно
objectscript.cpp:14469:9: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.cpp:8211:1: ошибка:   initializing argument 1 of «ObjectScript::OS::Core::PropertyIndex::PropertyIndex(ObjectScript::OS::Core::Value)»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::opIfNotJump()»:
objectscript.cpp:14704:33: ошибка: «class ObjectScript::OS::Core::MemStreamReader» has no member named «readInt32»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::opJump()»:
objectscript.cpp:14714:33: ошибка: «class ObjectScript::OS::Core::MemStreamReader» has no member named «readInt32»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::opLogicAnd()»:
objectscript.cpp:15046:33: ошибка: «class ObjectScript::OS::Core::MemStreamReader» has no member named «readInt32»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::opLogicOr()»:
objectscript.cpp:15058:33: ошибка: «class ObjectScript::OS::Core::MemStreamReader» has no member named «readInt32»
objectscript.cpp: In static member function «static void ObjectScript::OS::initObjectClass()::Object::userSortArrayByKeys(ObjectScript::OS*, ObjectScript::OS::Core::GCArrayValue*, int, bool)»:
objectscript.cpp:16169:23: ошибка: преобразование из «int» в «const ObjectScript::OS::Core::Value» неоднозначно
objectscript.cpp:16168:12: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: ошибка:   initializing argument 1 of «ObjectScript::OS::Core::Value& ObjectScript::OS::Core::Value::operator=(const ObjectScript::OS::Core::Value&)»
objectscript.cpp: In static member function «static int ObjectScript::OS::initObjectClass()::Object::push(ObjectScript::OS*, int, int, int, void*)»:
objectscript.cpp:16454:70: ошибка: преобразование из «int» в «ObjectScript::OS::Core::Value» неоднозначно
objectscript.cpp:16434:11: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.cpp:8211:1: ошибка:   initializing argument 1 of «ObjectScript::OS::Core::PropertyIndex::PropertyIndex(ObjectScript::OS::Core::Value)»
objectscript.cpp: In static member function «static int ObjectScript::OS::initObjectClass()::Object::getKeys(ObjectScript::OS*, int, int, int, void*)»:
objectscript.cpp:16641:51: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:16641:51: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.cpp: At global scope:
objectscript.cpp:17015:38: ошибка: expected «,» or «...» before «seed»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::randInitialize(unsigned int)»:
objectscript.cpp:17017:2: ошибка: нет декларации «rand_seed» в этой области видимости
objectscript.cpp:17017:14: ошибка: нет декларации «seed» в этой области видимости
objectscript.cpp:17019:9: ошибка: expected initializer before «*» token
objectscript.cpp:17020:9: ошибка: expected initializer before «*» token
objectscript.cpp:17022:3: ошибка: нет декларации «s» в этой области видимости
objectscript.cpp:17024:29: ошибка: нет декларации «r» в этой области видимости
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::randReload()»:
objectscript.cpp:17036:9: ошибка: expected initializer before «*» token
objectscript.cpp:17037:9: ошибка: expected initializer before «*» token
objectscript.cpp:17040:40: ошибка: нет декларации «p» в этой области видимости
objectscript.cpp:17041:8: ошибка: expected primary-expression before «unsigned»
objectscript.cpp:17041:8: ошибка: expected «)» before «unsigned»
objectscript.cpp:17041:47: ошибка: expected «)» before «;» token
objectscript.cpp:17041:47: ошибка: expected «)» before «;» token
objectscript.cpp:17043:28: ошибка: нет декларации «p» в этой области видимости
objectscript.cpp:17044:8: ошибка: expected primary-expression before «unsigned»
objectscript.cpp:17044:8: ошибка: expected «)» before «unsigned»
objectscript.cpp:17044:57: ошибка: expected «)» before «;» token
objectscript.cpp:17044:57: ошибка: expected «)» before «;» token
objectscript.cpp:17046:3: ошибка: нет декларации «p» в этой области видимости
objectscript.cpp:17046:7: ошибка: нет декларации «state» в этой области видимости
objectscript.cpp:17046:7: ошибка: expected primary-expression before «unsigned»
objectscript.cpp:17046:7: ошибка: expected «)» before «unsigned»
objectscript.cpp:17046:60: ошибка: expected «)» before «;» token
objectscript.cpp:17046:60: ошибка: expected «)» before «;» token
objectscript.cpp: В функции-члене «double ObjectScript::OS::Core::getRand()»:
objectscript.cpp:17058:19: ошибка: нет декларации «getpid» в этой области видимости
objectscript.cpp:17065:9: ошибка: expected initializer before «s1»
objectscript.cpp:17066:2: ошибка: нет декларации «s1» в этой области видимости
objectscript.cpp: In static member function «static int ObjectScript::OS::initMathModule()::Math::getrandseed(ObjectScript::OS*, int, int, int, void*)»:
objectscript.cpp:17274:40: ошибка: «class ObjectScript::OS::Core» has no member named «rand_seed»
objectscript.cpp: In static member function «static int ObjectScript::OS::initMathModule()::Math::setrandseed(ObjectScript::OS*, int, int, int, void*)»:
objectscript.cpp:17280:14: ошибка: «class ObjectScript::OS::Core» has no member named «rand_seed»
objectscript.cpp:17280:27: ошибка: expected primary-expression before «unsigned»
objectscript.cpp:17280:27: ошибка: expected «)» before «unsigned»
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::pushArgumentsWithNames(ObjectScript::OS::Core::StackFunction*)»:
objectscript.cpp:17648:74: ошибка: вызов перегруженной «Value(int)» имеет неоднозначную трактовку
objectscript.cpp:17648:74: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)
objectscript.cpp: В функции-члене «void ObjectScript::OS::Core::pushBackTrace(int, int)»:
objectscript.cpp:17703:122: ошибка: operands to ?: have different types «int» and «ObjectScript::OS::Core::Value»
objectscript.cpp:17704:120: ошибка: operands to ?: have different types «int» and «ObjectScript::OS::Core::Value»
objectscript.cpp:17713:48: ошибка: вызов перегруженной «Value(int&)» имеет неоднозначную трактовку
objectscript.cpp:17713:48: замечание: candidates are:
objectscript.cpp:9116:1: замечание: ObjectScript::OS::Core::Value::Value(ObjectScript::OS::Core::GCValue*) <near match>
objectscript.cpp:9116:1: замечание:   no known conversion for argument 1 from «int» to «ObjectScript::OS::Core::GCValue*»
objectscript.cpp:9104:1: замечание: ObjectScript::OS::Core::Value::Value(double)
objectscript.cpp:9098:1: замечание: ObjectScript::OS::Core::Value::Value(float)
objectscript.cpp:9080:1: замечание: ObjectScript::OS::Core::Value::Value(bool)
objectscript.h:1321:11: замечание: ObjectScript::OS::Core::Value::Value(const ObjectScript::OS::Core::Value&)

Binding function-local variable to returned lambda function

Okay, so previously I asked for a rather odd syntax, in which a function returns a function. However, just in this case, I wanted to know how this is done properly:

function target(name) {
    return function(targetData) {
        // do something...
        myTargets[name] = ...;
    };
}

I could test this out as a script...but I am wanting to implement things like that in C++. So here is the catch: How do I return a function, that is aware of a variable from the function from which it was returned?

Multithreading, unicode

приветствую

не появились ли какие-нибудь продвижения относительно многопотоковости?
может поддерживается какая-либо модель, типа эксклюзивной многопотоковости (когда только один поток шуршит внутри скрипта)?

и еще, UTF8 как поддерживается? длина строки посчитается в символах или в байтах? а регулярки как сработают на локальных символах?

пасиб

к сожалению не знаю как пометить запись как "вопрос" или "пожелание" :)

Does language support later compilation?

For example currently in PHP-world we have phc/hiphop compilers. Both of them are not ideal.

1st is not optimized -- 2nd is not developer-friendly.

Can we establish something like this in philosofy on language to implement feature like this later?

For example on dev node I dont' need compilation and c++-like speed, but on production!..

Some OS X fixes

Hey. Currently i am compiling on OS X, and I get a few errors. Those are rather simple:

  • malloc.h : On OS X, this is included as: <malloc/malloc.h>
  • A lot of -Wswitch warnings are shown, so I had to use -Wno-switch.
  • Following warning pops up:
objectscript.cpp:13206:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
objectscript.cpp:13206:17: note: place parentheses around the assignment to silence this warning
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                                     ^
                           (                                                                           )
objectscript.cpp:13206:17: note: use '==' to turn this assignment into an equality comparison
                        if(candidate = gc_candidate_values.get(OS_VALUE_VARIANT(value).value->value_id)){
                                     ^
                                     ==
1 warning generated.
  • Compiling an OS binary fails completely. I compiled objectscript.cpp and os-heap in src/obj, as well as copying the header files os-heap.h, objectscript.h and os-binder.h there too. The result:
Ingwie@Ingwies-Air ~/Work/objectscript $ g++ os.cpp src/obj/*.o -I src/obj -Isrc -o os
os.cpp:574:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                while(ok = compileLine()){
                      ~~~^~~~~~~~~~~~~~~
os.cpp:574:12: note: place parentheses around the assignment to silence this warning
                while(ok = compileLine()){
                         ^
                      (                 )
os.cpp:574:12: note: use '==' to turn this assignment into an equality comparison
                while(ok = compileLine()){
                         ^
                         ==
os.cpp:629:20: error: use of undeclared identifier 'environ'
                        initEnv("_ENV", environ);
                                        ^
1 warning and 1 error generated.

For the Last, I will look for a fix. But for the malloc thing:

#ifndef __APPLE__
#include <malloc.h>
#else
#include <malloc/malloc.h>
#endif

Kind regards! ^_^

Just an educational question

Hello there ^.^

I am currently just browsing GitHub, looking here and there, while spending my time with thinking about different ways to embed stuff into an application. And that was the way I came across thsi project here. And it once again made me ask: How do scripting languages work?

The reason I am asking here is rather simple. I see that a lot of syntaxes are mixed here - like the sugar syntax (yep, I read the "Programming in Objectscript" page completely) - making regular "read and parse" probably harder.

And that brings me to the first question: How does OS actually tokenize the input script? Does it iterate over each character (byte) one by one? Or how does it do that?

The second question: How hard is it, to implement a new feature into an existing language like OS? Like, I am looking for a way to bring ObjC syntax to a scripting language. To me, that syntax makes a lot of sense - having objects, that can recieve messages. Just imagine a multi-threading application, and you have a global object to send messages between the threads. That kind of syntax is nice, and I just cant imagine how it would be implemented. Because, I know that [] are already used to create arrays and denote object/array entries - so that token already has a sense. But it has two purposes - how does a prser like the one OS has know which purpose it has to expect?

Then my third question: How does OS pass the arguments so directly, that it can litterally take a C/++ function pointer and pass the original types to its arguments? from what I know about C++, the functions are pre-defined, and its not (correct me if I am wrong) possible to dynamically pass arguments to a function...? I could guess that all the function arguments are first turned into voids, and upon the call, are converted to their original type again...but yet, I dont know how to think about that.

I really like ObjectScript, and I want to do more with it. There is just one thing that I am always looking for: implementing into an existing project.
My project uses GYP - so I can not use CMake. Which files do I need to get a basic OS runtime together? I see there are a lot of extensions too - as well as bindings for ncuses and the like. How do I compile OS "by hand"?

Hope this isnt too much to answer, really. ^^; But I am very curios about scripting languages - especially those that are easy to reuse / implement into existing applications to make them scriptable.

Kind regards, Ingwie

Очень не хватает документации для разработчиков на OS

Здравствуйте!
Очень нравится концепция и синтаксис.
Я понимаю, что язык ещё только развивается, но очень бы неплохо хотя бы одну-две странички документации (здесь, на Гитхабе, в Вики или просто в ридмишке), которая бы объясняла, как писать программы на OS тем, кто не умеет C++.
Я вообще-то вебер: PHP, JavaScript и всё такое. Сейчас ищу для себя хороший "оффлайновый" язык. И вот... хотелось бы документацию).
Спасибо!

Can not serialize the debug backtrace?

OS 2.6.4-rc-x64 Copyright (C) 2012-2014 by Evgeniy Golovin
ObjectScript is free and open source: https://github.com/unitpoint/objectscript
> function f(){ print json.encode(debugBackTrace()); }
<function#2370>
> f()

Unhandled exception: 'DateTime 'this' must not be null'

#0 {{CORE}}: f, args: {}

When running OS remotely and using JSON as a layer of communication, this is rather problematic. How can I get the backtrace as JSON?

Make MySQL optional

Hey.

Is there a way to make the Mysql stuff optional? I want to try OS, but I do not want to install MySQL rightnow (I am running it in a different version under MAMP and am using that version from the command line).

Kind regards, Ingwie

Syntactical question

So I just realized something while working on IceTea.

ObjectScript supports the non-paranthese style function calling...but what happens, if there is a functionb eing returned? Here is an example:

function foo(inString) {
    // Do something with inString...
    return function(inObj) { ... };
}

// What would happen now?
foo("MyString") { myValue: "a" };

// In theory, the actual call should be
foo("MyString")({myValue: "a"});

Is that kind of syntax possible? I am moving laptops at the moment so I dont have a compiled objectscript binary to test this against...

specs: Language naming standard

Do we have one?

I just hate PHP for this_style or thisstyle or stylethis naming of functions and etc.

Also as was mentioned in another issue about rsort/sort/reverse or something similar -- we should have one single style of naming. Single and rocking-hard, as mr. Medveded said -- "Pissed in stone".

Can we?

Ссылки

Ссылки на переменные, как в PHP (или, как в Си, наверное, когда переменная ссылается не на значение, а на адрес).

var a = 10;
var b = &a

b = (b + 1);

print(a, b);

Вернёт 11, 11.

Можно в противовес ключевому слову clone (используемое для объектов и массивов), как в D использовать слово ref

var a = 10;
var b = ref a

b = (b + 1);

print(a, b);

В том числе и для параметров функции

var a = 1;

function my(ref outter){
   outter = (outter + 1);
}

my(a);
print a; // 2

Порой это очень удобно.

Crash on launch

Hey. I have compiled ObjectScript's os.cpp with a bunch of -DOS_xyz_DISABLED and just wanted to launch it, and I am getting here, which asuesa segfault 11.

* thread #1: tid = 0x9858e1, 0x00000001000ae84d os`ObjectScript::OSHeapManager::allocMedium(this=0x0000000100300000, size=2920) + 685 at os-heap.cpp:424, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x100f4af)
    frame #0: 0x00000001000ae84d os`ObjectScript::OSHeapManager::allocMedium(this=0x0000000100300000, size=2920) + 685 at os-heap.cpp:424
   421      medium_stats.registerAlloc(block->size, data_size);
   422  
   423      OS_BYTE * p = OS_STRUCT_OFFS(block, 1);
-> 424      p[-1] = BT_MEDIUM;
   425  
   426  #ifdef OS_DEBUG
   427      *(int*)p = DUMMY_MEDIUM_USED_ID_PRE;
(lldb) bt
* thread #1: tid = 0x9858e1, 0x00000001000ae84d os`ObjectScript::OSHeapManager::allocMedium(this=0x0000000100300000, size=2920) + 685 at os-heap.cpp:424, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x100f4af)
    frame #0: 0x00000001000ae84d os`ObjectScript::OSHeapManager::allocMedium(this=0x0000000100300000, size=2920) + 685 at os-heap.cpp:424
    frame #1: 0x00000001000af272 os`ObjectScript::OSHeapManager::malloc(this=0x0000000100300000, size=2896) + 130 at os-heap.cpp:817
    frame #2: 0x0000000100067483 os`ObjectScript::OS::malloc(this=0x0000000100203a90, size=2896) + 35 at objectscript.cpp:14855
    frame #3: 0x0000000100069005 os`ObjectScript::OS::init(this=0x0000000100203a90, p_manager=0x0000000000000000) + 149 at objectscript.cpp:15073
    frame #4: 0x0000000100002ff7 os`ConsoleOS::init(this=0x0000000100203a90, mem=0x0000000000000000) + 39 at os.cpp:147
    frame #5: 0x0000000100068f23 os`ObjectScript::OS::start(this=0x0000000100203a90, manager=0x0000000000000000) + 51 at objectscript.cpp:15063
    frame #6: 0x0000000100000f7f os`ConsoleOS* ObjectScript::OS::create<ConsoleOS>(os=0x0000000100203a90, manager=0x0000000000000000) + 47 at objectscript.h:3040
    frame #7: 0x0000000100000f03 os`main(argc=1, argv=0x00007fff5fbffbe8) + 83 at os.cpp:879
    frame #8: 0x00007fff8f8b55fd libdyld.dylib`start + 1
    frame #9: 0x00007fff8f8b55fd libdyld.dylib`start + 1

I compiled it this way:

 $ build --view=make all
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-json -M -MG objectscript/src/ext-json/os-json.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-json -c -o objectscript/src/ext-json/os-json.o objectscript/src/ext-json/os-json.cpp
ar cr ./out/libos_ext-json.a objectscript/src/ext-json/os-json.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-datetime -M -MG objectscript/src/ext-datetime/os-datetime.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-datetime -c -o objectscript/src/ext-datetime/os-datetime.o objectscript/src/ext-datetime/os-datetime.cpp
ar cr ./out/libos_ext-datetime.a objectscript/src/ext-datetime/os-datetime.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-url -M -MG objectscript/src/ext-url/os-url.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-url -c -o objectscript/src/ext-url/os-url.o objectscript/src/ext-url/os-url.cpp
ar cr ./out/libos_ext-url.a objectscript/src/ext-url/os-url.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/os-hashlib.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/os-hashlib.o objectscript/src/ext-hashlib/os-hashlib.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/sha/hmac.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/sha/hmac.o objectscript/src/ext-hashlib/sha/hmac.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/sha/sha1.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/sha/sha1.o objectscript/src/ext-hashlib/sha/sha1.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/sha/sha224-256.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/sha/sha224-256.o objectscript/src/ext-hashlib/sha/sha224-256.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/sha/sha384-512.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/sha/sha384-512.o objectscript/src/ext-hashlib/sha/sha384-512.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/sha/usha.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/sha/usha.o objectscript/src/ext-hashlib/sha/usha.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/des/des.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/des/des.o objectscript/src/ext-hashlib/des/des.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -M -MG objectscript/src/ext-hashlib/md5/md5.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-hashlib/sha  -Iobjectscript/src/ext-hashlib/des  -Iobjectscript/src/ext-hashlib/md5 -c -o objectscript/src/ext-hashlib/md5/md5.o objectscript/src/ext-hashlib/md5/md5.cpp
ar cr ./out/libos_ext-hashlib.a objectscript/src/ext-hashlib/os-hashlib.o objectscript/src/ext-hashlib/sha/hmac.o objectscript/src/ext-hashlib/sha/sha1.o objectscript/src/ext-hashlib/sha/sha224-256.o objectscript/src/ext-hashlib/sha/sha384-512.o objectscript/src/ext-hashlib/sha/usha.o objectscript/src/ext-hashlib/des/des.o objectscript/src/ext-hashlib/md5/md5.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -DOS_CURL_DISABLED -DOS_SQLITE3_DISABLED -DOS_REGEXP_DISABLED  -DOS_ICONV_DISABLED -DOS_ZLIB_DISABLED -DOS_ODBO_DISABLED -M -MG objectscript/src/../os.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -DOS_CURL_DISABLED -DOS_SQLITE3_DISABLED -DOS_REGEXP_DISABLED  -DOS_ICONV_DISABLED -DOS_ZLIB_DISABLED -DOS_ODBO_DISABLED -c -o objectscript/src/../os.o objectscript/src/../os.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src -M -MG objectscript/src/objectscript.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src -c -o objectscript/src/objectscript.o objectscript/src/objectscript.cpp
objectscript/src/objectscript.cpp:1379:9: warning: 9 enumeration values not handled in switch: 'OUTPUT_STRING', 'OUTPUT_NEXT_VALUE', 'REGEXP_STRING'... [-Wswitch]
        switch(token_type){
               ^
objectscript/src/objectscript.cpp:1521:10: warning: 66 enumeration values not handled in switch: 'NOTHING', 'COMMENT_LINE', 'COMMENT_MULTI_LINE'... [-Wswitch]
                switch(type)
                       ^
objectscript/src/objectscript.cpp:1539:10: warning: 29 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
                switch(type)
                       ^
objectscript/src/objectscript.cpp:2415:9: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:2439:9: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:2464:9: warning: 122 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:2482:9: warning: 120 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:2504:9: warning: 88 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:2569:9: warning: 119 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:3657:11: warning: 55 enumeration values not handled in switch: 'OP_NEW_FUNCTION', 'OP_NEW_ARRAY', 'OP_NEW_OBJECT'... [-Wswitch]
                        switch(opcode){
                               ^
objectscript/src/objectscript.cpp:4271:9: warning: 69 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
        switch(token_type){
               ^
objectscript/src/objectscript.cpp:4283:9: warning: 27 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
        switch(token_type){
               ^
objectscript/src/objectscript.cpp:4344:9: warning: 78 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp_type){
               ^
objectscript/src/objectscript.cpp:4555:10: warning: 131 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NEW_LOCAL_VAR', 'EXP_TYPE_SCOPE'... [-Wswitch]
                switch(exp->type){
                       ^
objectscript/src/objectscript.cpp:4657:12: warning: 120 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                                switch(param_exp->type){
                                       ^
objectscript/src/objectscript.cpp:4593:9: warning: 93 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:4757:9: warning: 122 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5026:13: warning: 129 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                                        switch(get_exp->type){
                                               ^
objectscript/src/objectscript.cpp:5095:12: warning: 129 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                                switch(get_exp->type){
                                       ^
objectscript/src/objectscript.cpp:5153:11: warning: 129 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                        switch(right_exp->type){
                               ^
objectscript/src/objectscript.cpp:4808:9: warning: 112 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5176:9: warning: 116 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5251:9: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5278:9: warning: 118 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5365:9: warning: 96 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:5524:11: warning: 108 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                        switch(exp->type){
                               ^
objectscript/src/objectscript.cpp:6258:10: warning: 130 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                switch(exp1->type){
                       ^
objectscript/src/objectscript.cpp:6433:10: warning: 128 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                switch(exp1->type){
                       ^
objectscript/src/objectscript.cpp:7371:9: warning: 73 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
        switch(recent_token->type){
               ^
objectscript/src/objectscript.cpp:8882:9: warning: 70 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'BEGIN_BRACKET_BLOCK'... [-Wswitch]
        switch(recent_token->type){
               ^
objectscript/src/objectscript.cpp:8894:9: warning: 129 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp->type){
               ^
objectscript/src/objectscript.cpp:8967:10: warning: 118 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                switch(exp_type){
                       ^
objectscript/src/objectscript.cpp:9015:9: warning: 115 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp_type){
               ^
objectscript/src/objectscript.cpp:9236:11: warning: 126 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                        switch(var_exp_left->type){
                               ^
objectscript/src/objectscript.cpp:9262:11: warning: 128 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                        switch(var_exp_right->type){
                               ^
objectscript/src/objectscript.cpp:9531:11: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                        switch(exp->type){
                               ^
objectscript/src/objectscript.cpp:9854:11: warning: 71 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
                        switch(token_type){
                               ^
objectscript/src/objectscript.cpp:9849:10: warning: 128 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
                switch(exp->type){
                       ^
objectscript/src/objectscript.cpp:9834:9: warning: 53 enumeration values not handled in switch: 'NOTHING', 'PARAM_SEPARATOR', 'COMMENT_LINE'... [-Wswitch]
        switch(token_type){
               ^
objectscript/src/objectscript.cpp:10274:9: warning: 20 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NEW_LOCAL_VAR', 'EXP_TYPE_BREAK'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:11006:9: warning: 103 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(exp_type){
               ^
objectscript/src/objectscript.cpp:12871:9: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:12941:9: warning: 127 enumeration values not handled in switch: 'EXP_TYPE_UNKNOWN', 'EXP_TYPE_NOP', 'EXP_TYPE_NEW_LOCAL_VAR'... [-Wswitch]
        switch(type){
               ^
objectscript/src/objectscript.cpp:14314:11: warning: 4 enumeration values not handled in switch: 'OS_VALUE_TYPE_UNKNOWN', 'OS_VALUE_TYPE_NULL', 'OS_VALUE_TYPE_BOOL'... [-Wswitch]
                        switch(value->type){
                               ^
objectscript/src/objectscript.cpp:17149:10: warning: 54 enumeration values not handled in switch: 'OP_NEW_FUNCTION', 'OP_NEW_ARRAY', 'OP_NEW_OBJECT'... [-Wswitch]
                switch(opcode){
                       ^
objectscript/src/objectscript.cpp:17163:10: warning: 54 enumeration values not handled in switch: 'OP_NEW_FUNCTION', 'OP_NEW_ARRAY', 'OP_NEW_OBJECT'... [-Wswitch]
                switch(opcode){
                       ^
objectscript/src/objectscript.cpp:17230:11: warning: 41 enumeration values not handled in switch: 'OP_NEW_FUNCTION', 'OP_NEW_ARRAY', 'OP_NEW_OBJECT'... [-Wswitch]
                        switch(opcode){
                               ^
objectscript/src/objectscript.cpp:17358:10: warning: 41 enumeration values not handled in switch: 'OP_NEW_FUNCTION', 'OP_NEW_ARRAY', 'OP_NEW_OBJECT'... [-Wswitch]
                switch(opcode){
                       ^
objectscript/src/objectscript.cpp:18209:10: warning: 9 enumeration values not handled in switch: 'OS_VALUE_TYPE_UNKNOWN', 'OS_VALUE_TYPE_NULL', 'OS_VALUE_TYPE_BOOL'... [-Wswitch]
                switch(val->type){
                       ^
objectscript/src/objectscript.cpp:18654:9: warning: 4 enumeration values not handled in switch: 'OS_VALUE_TYPE_UNKNOWN', 'OS_VALUE_TYPE_NULL', 'OS_VALUE_TYPE_BOOL'... [-Wswitch]
        switch(value->type){
               ^
objectscript/src/objectscript.cpp:22156:11: warning: 5 enumeration values not handled in switch: 'OS_VALUE_TYPE_UNKNOWN', 'OS_VALUE_TYPE_NULL', 'OS_VALUE_TYPE_BOOL'... [-Wswitch]
                        switch(self->type){
                               ^
objectscript/src/objectscript.cpp:25634:11: warning: 71 enumeration values not handled in switch: 'NOTHING', 'BEGIN_CODE_BLOCK', 'END_CODE_BLOCK'... [-Wswitch]
                        switch(type){
                               ^
52 warnings generated.
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src -M -MG objectscript/src/os-heap.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src -c -o objectscript/src/os-heap.o objectscript/src/os-heap.cpp
objectscript/src/os-heap.cpp:210:16: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        OS_BYTE * p = OS_STRUCT_OFFS(small_block, 1);
                      ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:243:42: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        SmallBlock * small_block = (SmallBlock*)OS_STRUCT_OFFS((SmallBlock*)p, -1);
                                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:277:42: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        SmallBlock * small_block = (SmallBlock*)OS_STRUCT_OFFS((SmallBlock*)p, -1);
                                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:423:16: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        OS_BYTE * p = OS_STRUCT_OFFS(block, 1);
                      ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:453:26: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        Block * block = (Block*)OS_STRUCT_OFFS((Block*)p, -1);
                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:511:26: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        Block * block = (Block*)OS_STRUCT_OFFS((Block*)p, -1);
                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:579:16: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        OS_BYTE * p = OS_STRUCT_OFFS(block, 1);
                      ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:612:26: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        Block * block = (Block*)OS_STRUCT_OFFS((Block*)p, -1);
                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:643:26: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        Block * block = (Block*)OS_STRUCT_OFFS((Block*)p, -1);
                                ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
objectscript/src/os-heap.cpp:775:16: warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
                                void * p = OS_STRUCT_OFFS(block, 1) + OS_DUMMY_ID_SIZE/2;
                                           ^
objectscript/src/os-heap.h:105:33: note: expanded from macro 'OS_STRUCT_OFFS'
#define OS_STRUCT_OFFS(s, offs) (OS_BYTE*)((int)(intptr_t)(s) + OS_HEAP_SIZE_ALIGN(sizeof(*s))*(offs))
                                ^
10 warnings generated.
ar cr ./out/libos.a objectscript/src/objectscript.o objectscript/src/os-heap.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-process -M -MG objectscript/src/ext-process/os-process.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-process -c -o objectscript/src/ext-process/os-process.o objectscript/src/ext-process/os-process.cpp
ar cr ./out/libos_ext-process.a objectscript/src/ext-process/os-process.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-filesystem -M -MG objectscript/src/ext-filesystem/os-filesystem.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-filesystem -c -o objectscript/src/ext-filesystem/os-filesystem.o objectscript/src/ext-filesystem/os-filesystem.cpp
ar cr ./out/libos_ext-filesystem.a objectscript/src/ext-filesystem/os-filesystem.o
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -M -MG objectscript/src/ext-base64/cdecode.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -c -o objectscript/src/ext-base64/cdecode.o objectscript/src/ext-base64/cdecode.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -M -MG objectscript/src/ext-base64/cencode.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -c -o objectscript/src/ext-base64/cencode.o objectscript/src/ext-base64/cencode.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -M -MG objectscript/src/ext-base64/os-base64.cpp
clang++  -fPIC -fno-common -Wno-pointer-sign -g  -Ilibuv/include  -Iuvpp  -Ihttp-parser  -Ic-ares/include  -Isqlite3  -ITrololo  -Ittvfs/ttvfs -Ittvfs/ttvfs_zip  -Ilibcanister  -Ilibucl/include  -Iobjectscript/src  -Iobjectscript/src/ext-base64 -c -o objectscript/src/ext-base64/os-base64.o objectscript/src/ext-base64/os-base64.cpp
ar cr ./out/libos_ext-base64.a objectscript/src/ext-base64/cdecode.o objectscript/src/ext-base64/cencode.o objectscript/src/ext-base64/os-base64.o
clang++ -o ./out/os objectscript/src/../os.o  -L./out -Llibchromiumcontent_mac/Release  -los_ext-process -los_ext-filesystem  -los_ext-hashlib -los_ext-url  -los_ext-base64 -los_ext-datetime  -los_ext-json -los -lpthread
clang++ -dynamiclib -all_load out/*.a -o ./out/libPhoenixEngine.dylib
mkdir -p './out/PhoenixEngine.framework'
mkdir -p './out/PhoenixEngine.framework/Resources'
mkdir -p './out/PhoenixEngine.framework/Libraries'
cp './out/libPhoenixEngine.dylib' './out/PhoenixEngine.framework/Phoenix Engine'

There is a bit more stuff in there than just objectscript, its just part of the build process. But it should give away what exactly I am doing to compile it.

Do you know why I get the segfault? o.o

Kind regards, Ingwie

syntax: About commas

Commas are maid to easier reading. So avoiding then in code is a big minus to reader. See +100500 books about programming -- most of the time we read the code.

"Вес" скобок

echo (math).PI это echo (math), а должно быть echo ((math).PI). Хотя я готов принять это за фишку. :))

ошбка компиляции в vs2012

привет!
при компиляции objectscript.cpp в visual studio 2012 вылазит ошибка:
Ошибка 1 error C4703: используется потенциально неинициализированная локальная переменная-указатель "table_value". если присвоить нулл при объявлении, то все ок.

malloc.h still not found :)

I am very sure I reported this before...

in src/os-heap.cpp, replace

include <malloc.h>

with

#ifndef __APPLE__
#include <malloc.h>
#else
#include <malloc/malloc.h>
#endif

:)

Kind regards, Ingwie.

У Number и Boolean нет this

var test = function(type){
    print(type..':');
    return this;  
}

Object.test = test;
Array.test = test;
String.test = test; 
Number.test = test;
Boolean.test = test;

print({a = 1, b = 2, c = 3}.test('object'));
print([1, 2, 3].test('array'));
print('ABC'.test('string'));
print((123).test('number'));
print(true.test('boolean'));

Возвращает

object:
{"a":1,"b":2,"c":3}
array:
[1,2,3]
string:
ABC
number:
null
boolean:
null

if(0) - возвращает true

// ****************
if(0)
print("true")
else
print("false");
// ****************
такой код выводит:
true

но это еще не все: по аналогии while(0) - это вечный цикл :), и еще if("") - тоже вернет true

насколько я понимаю это "фича" языка, но уж больно она идет вразрез с остальными языками

Упразднить методы rsort() и krsort()

Удалить данные методы, но (опционально, так как легко реализуется силами OS) добавив reverse() отдельным.

Обратную сортировку всё равно легко сделать колбэком:

var a = [20, 1, 40, 99, 100];

a.sort(function(a, b){
    return a < b;
});

print(a);

С krsort() тоже самое. Жаль, что метод ksort() сложно упразднить.

А reverse-аналоги могут привести к тому нагромождению sort-функций, что есть сейчас в PHP (их там около десятка считая reverse-версии).

P.S. К тому же нелогично: rsort(), krsort(), но reverseIter(), а не riter(). :)

Segmentation fault

When running os without parameters, I got interpreter mode. When I type help, I got segmentation fault error.

gdb out:

Reading symbols from /home/baldrs/objs/objectscript/bin/os...done.
(gdb) run
Starting program: /home/baldrs/objs/objectscript/bin/os 
(os) help

Program received signal SIGSEGV, Segmentation fault.
0x08053e49 in ObjectScript::OS::Core::Compiler::putNextTokenType (
    this=0xbffff168, 
    token_type=ObjectScript::OS::Core::Tokenizer::CODE_SEPARATOR)
    at source/objectscript.cpp:3633
3633        TokenData * token = new (malloc(sizeof(TokenData) OS_DBG_FILEPOS)) TokenData(recent_token->text_data, String(allocator), token_type, recent_token->line, recent_token->pos);

as seen from log it's caused by missing ';' after variable name

Accessing object properties

So I know that I have to do something like this, in order to store object stuff.

os->newObject();
os->pushNumber(10);
os->setProperty("myInt", -2); // Why not -1?

Now, lets say we get an object passed to a native function with a structure like:

{ 
    "Name": "Bill", 
    "Age": 20 
}

How does one now access the property "Name"? I have seen that there is

        void getProperty(bool getter_enabled = true, bool prototype_enabled = true);
        void getProperty(const OS_CHAR*, bool getter_enabled = true, bool prototype_enabled = true);
        void getProperty(const Core::String&, bool getter_enabled = true, bool prototype_enabled = true);
        void getProperty(int offs, const OS_CHAR*, bool getter_enabled = true, bool prototype_enabled = true);
        void getProperty(int offs, const Core::String&, bool getter_enabled = true, bool prototype_enabled = true);

But how exactly does it work? For a test example, let's imagine a function like this:

int SayHi(OS* os, ...) {
    std::string name;
    // Somehow fetch the string from the Name property and store it.
    cout << "Hey, " << name << "! Long time no see." << endl;
}

GC

Для игровой разработки критично время GC.
Очень хорошо что бы на ряду с GC был ReferenceCounters, что бы можно было отказаться от GC вообще.

См. Squirrel

Развитие языка

  1. Сейчас у вас идёт работа над биндингом SQLite и cURL, над fcgi и уклон в сторону веба, что, мне кажется, не совсем верно.

Может быть, для популяризации языка и одновременно использования его в вебе сделать ObjectScript-реализацию над node.js - прокси-языком, как CoffeeScript?

  1. Заострить развитие OS, как встраиваемого языка. По крайней мере пока не обвешивать язык модулями и функционалом, а заниматься ядром.
  2. Разбить objectscript.cpp на файлы токенайзера, парсера, модулей и ядро. objectscript.cpp становится всё большее и большее. Очень сложно ориентироваться.
  3. Причесать файлы и директории. В каждой отдельно и в основной разместить README.md с описанием файлов и внутренностей.
  4. Начать разработку сайта, придумать логотип. Так сказать, дать языку "человеческое лицо". Маскота какого-нибудь придумать. В общем, все те не особо нужные, но приятные душе и иногда полезные вещи.

С пунктами 1, 4 и 5 (тут попрошу дизайнера) я бы мог помочь.

целые числа

привет!
как я понял из документации для представления чисел есть только один тип Number и внутри он является double. как быть если мне нужен обычный 32х разрядный int, аналогичный тому что в C++?

About Core::* types

I just had to do some reverse engeneering on the code, because I was very curios:

  1. How do I obtain "function pointers" from the script. As in: myFunc{value, function(){ ...callback... });
  2. How do I store a function away for later use?
  3. How can I obtain other types as permanent values?

Originally, I wondered about that with V8's C++ api in mind, where you have Local<...> and Persistant<...> types. The classes to fill into the template are either String, Number, Object, Function or any other valid JS type that is found under the v8 Namespace.

And secondarily, I wanted to learn more about the VM behind ObjectScript. Because - I wanted to know how data is saved and represented there. Boy I was not expecting what I found:

class Core {
    struct Value { ... }
    struct GCFunctionValue : public GCValue {...}
    struct GC{other type name}: public GCValue {...}
    class String { ... }
    class Buffer { ... }
}

As the class title suggested, those types were ment to be used internally. But - why?

As I asked in my previous questions, it would be highly usable to convert a type from the VM into something that C++ land understands. Turning something like this:

var callbackData = {
    beforeAction: function(){ ... },
    afterAction:  function(){ ... }
};

into something like this:

class OS::Value {
public:
    ...
    operator[](const OS_CHAR key);
    operator[](...);
    ...
    OS_EValueType type();
    void pushValue(OS*);
};

// In a function
OS::Value callbackData = os->getValue(...);
if(callbackData.isset("beforeAction")) {
    callbackData["beforeAction"]->pushValue(os);
    ...
    os->call(...);
}

For the case of embedding OS into a C++ application, it would make things very, very easy to be able to keep a refference to a function passed to a function and re-use it later. I have not come very far in my studdy yet, so I have to ask you for the implementation. But it could make things quite easy for embedding.

What is your opinion on this? Do you think it's do-able? Please let me know! I am kinda stuck with my previous issue at this moment...

os-fcgi: process.cwd() returning nothing...

So I wanted to do some serious work on my FlapWorks framework for OS...untill:

<code><%
echo typeOf(process.cwd())
echo ": "
echo process.cwd().length
%></code>

Returned:

string: 0

o.o... I did look into os-fcgi.cpp and figured, that it only called os->require(), but there is no indication that we're changing directories at all. These are the _SERVER variables that I am giving OS...

FCGI_ROLE: RESPONDER
PATH_INFO: 
PATH_TRANSLATED: /Users/Ingwie/public_html
QUERY_STRING: 
REQUEST_METHOD: GET
CONTENT_TYPE: 
CONTENT_LENGTH: 
SCRIPT_NAME: /fw/index.osh
REQUEST_URI: /fw/
DOCUMENT_URI: /fw/index.osh
DOCUMENT_ROOT: /Users/Ingwie/public_html
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
SERVER_SOFTWARE: nginx/1.6.1
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 56150
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
SERVER_NAME: localhost
REDIRECT_STATUS: 200
HTTP_HOST: localhost
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
HTTP_COOKIE: < ... Cut out ... >
SCRIPT_FILENAME: /Users/Ingwie/public_html/fw/index.osh

Which value is being set wrong? Same values are given to PHP:

USER: Ingwie
HOME: /Users/Ingwie
FCGI_ROLE: RESPONDER
QUERY_STRING: 
REQUEST_METHOD: GET
CONTENT_TYPE: 
CONTENT_LENGTH: 
SCRIPT_NAME: /index.php
REQUEST_URI: /index.php
DOCUMENT_URI: /index.php
DOCUMENT_ROOT: /Users/Ingwie/public_html
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
SERVER_SOFTWARE: nginx/1.6.1
REMOTE_ADDR: 127.0.0.1
REMOTE_PORT: 56264
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
SERVER_NAME: localhost
REDIRECT_STATUS: 200
SCRIPT_FILENAME: /Users/Ingwie/public_html/index.php
PATH_INFO: 
PATH_TRANSLATED: /Users/Ingwie/public_html/index.php
HTTP_HOST: localhost
HTTP_CONNECTION: keep-alive
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
HTTP_COOKIE: < ... Cut out ... >
PHP_SELF: /index.php
REQUEST_TIME_FLOAT: 1428121616.2923
REQUEST_TIME: 1428121616

The OS::call*() functions

As I haven't seen you in Skype in a while, I have been working on finalizing ObjectScriptValue. It can actually already be used, which is plain awesome. But I am a bit stuck on the function calling - especially, that there are three functions:

void call(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO);   // stack: func, this, params
        void callFT(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO); // stack: func, this, params
        void callTF(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO); // stack: this, func, params

What is the difference? Assuming the following:

os->pushString("foo");
os->pushNumber(20);
os->getGlobal("myFunc"); // or ->pushValueById(functionID)
os->call(2, 1);

What would be the difference in using callFT(...) and callTF(...)?

EDIT:
Just realized, might should have put the stack placement of the function at the top. But I think you get what I am asking for. Besides, I just pushed the latest code to the ObjectScriptValue repo.

'a' > 1

print('a' > 1);

Вернёт true, хотя должен false. Проверил в PHP, JS, Perl'е.

Cannot compile on Mageia 4

$ mkdir build && cd build
$ cmake -DBUILD_SOCI=ON -DCMAKE_INSTALL_PREFIX=/ ..
CMake Error at CMakeLists.txt:156 (message):
  [ ERROR ]: Couldn't find PCRE library
....................................
$ rpm -qi lib64pcre-devel
Name        : lib64pcre-devel
Version     : 8.33
Release     : 2.mga4
Architecture: x86_64
Install Date: Чт 04 сен 2014 13:31:57
Group       : Development/C
Size        : 1207151
License     : BSD-Style
Signature   : RSA/SHA1, Сб 19 окт 2013 17:13:15, Key ID b742fa8b80420f66
Source RPM  : pcre-8.33-2.mga4.src.rpm
Build Date  : Сб 19 окт 2013 17:04:55
Build Host  : sucuk.mageia.org
Relocations : (not relocatable)
Packager    : umeabot <umeabot>
Vendor      : Mageia.Org
URL         : http://www.pcre.org/
Summary     : Headers and static lib for pcre development
Description :
Install this package if you want do compile applications using the pcre
library.
$ lsb_release -a
LSB Version:    *
Distributor ID: Mageia
Description:    Mageia 4
Release:    4
Codename:   thornicroft
$ uname -a
Linux localhost 3.14.24-desktop-1.mga4 #1 SMP Sat Nov 15 23:54:03 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.