2019-08-16 17:56:42

Hy!
For some time now, I considered opening this matter to a debate, taking into account the flameware consuming each and every topic in which there is the slightest eancling about bgt, so, I decided for it, damm the consequences.
My first programming language ever was bgt, so it seems natural to want to resurect it's korps
smile
As my programming skils  improved, I noticed the nerrow mindedness and the ever growing number of limitations of the bgt language like not being able to create and pass C structs as wellll as passing callbacks to a dll like autoit does and many others, so I started trying out other programming languages like pb, python, C/c++, java, etc.
There were many problems with those languages like not supporting object orientation(pb), having so many libraries, packages/namespaces and classes that remembering each library and function along with it's purpose is next to impossible(java). So, I decided to take the matter in my own two hands, enhancing bgt with the power of .net framework.
Offcourse, in order to keep backwards compatibility, I'll use angelscript as the script interpreter, the bass library and it's .net wrapper for sound related stuff, windows forms for gui, something that I don't know of for regular expressions and pb functions as a dll and .net wrapper around them for everything else.
For the time being, I'm reading the angelscript documentation and examples to figure out how it works.
I have two little questions, though:
Should I persue this matter further? Is it worth it?
Can anyone teal me whether a .net wrapper around angelscript with or withoutthe C interface is possible? If so, can anyone give me an example of it?

2019-08-16 18:39:12

If you release anything I for one would try it. I'd love to be able to have gui functions in bgt, I've always wanted that. It would really open up the possibilities of creating things other than games with it. One thing I would also love to see is the ability to create windows with system keys support, so you can press alt to get to the menu where you can maximise the window and what not, heck, maybe even add the ability for us to add menues to the thing and shortcuts to access them, etc.

2019-08-16 19:43:11

The System.Windows.Forms assembly provides all those features and many more, but, because of the way System.Windows.Forms is implemented, I must warn you, gui creation with the new bgt will never be easy, if you ever worked with c# you know what I'm talking about.
With this occasion, I'd like to mention some notes that I left out in the previous post:
1: The name of the new bgt must be changed because bgt is copyrighted and I am open for suggestions.
2: Since I can't understand the licience agreements most of the time, if you find any copiright violation in this topic, please let me know by replying to this topic.
3: Don't expect a releas soon for the angelscript documentation is verry ambiguous some times and I still don't know nither wheder I could generate a .net wrapper around angelscript nor how to integrate the C interface or how many people will want this since if there aren't enough people wanting this, I will not persue the matter further. In conclusion, We can't speak about a release untill some months passed to make shure that a .net wrapper around angelscript is possible.

2019-08-16 20:18:34

This would be really awesome. I would try it out and if you can do it and it works, i may also replace my normal bgt compiler with it.

Lamas with hats, but with sponge bob as carl Stay tuned.

https://www.youtube.com/channel/UCvAUQt … subscriber

2019-08-16 20:53:59

ile learn bgt first, then triit.

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2019-08-16 21:02:30

Sounds cool. Though make sure it supports 64-bit out of the box, as 32-bit seems to be dying very quickly.

I've been going by Bryn, which is now reflected in my profile. Please do your best to respect this :) Mess ups are totally OK though, I don't mind and totally understand!
Follow on twitter! @ItsBrynify
Thanks, enjoy, thumbs up, share, like, hate, exist, do what ya do,
my website: brynify.me

2019-08-16 22:36:17

masonian wrote:

Sounds cool. Though make sure it supports 64-bit out of the box, as 32-bit seems to be dying very quickly.

I could not verify since my computer is not amd64 compliant, so I have to rely on my c# compiler to compile for any cpu, but I can't say the same regarding the unmanaged code from libangelscript.so, libespeak.so and many others.

2019-08-17 01:39:37

If these libraries are .so then your on Linux. They should be .dll or .lib for Windows.
Not really sure why you would want to do this; why not go with a language like Python instead?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-17 02:03:09

I have both .so and .dll files because I work on both a windows laptop and an ubuntu birtual machine with mono.
I am doing this both as a learning project  as well as for people that still use bgt despite it's  limitations.
Do you know whether angelscript can be wraped with .net?

2019-08-17 04:08:26 (edited by Ethin 2019-08-17 04:11:58)

@9, I get the inspiration, but to me its just not a good idea. BGT needs to die -- hell, its already dead. BGT has limitations that even you cannot overcome, one of which is the extreme lack of recognition by the rest of the world. If you post a BGT question on stack overflow you will never get an answer. If you post a Python question on stack overflow, you'll get an answer, if not several, all of which may be very good ideas. Yes, PB doesn't support object orientation, but that was never, I think, in its design. Hell, its practically discontinued. Your problem with Java doesn't really count as a problem with the language, as there are thousands, if not millions, of programmers who would adamantly disagree, and is more of a problem that you have, which is perfectly acceptable. Java, then, may not be suited to you. Nor may PB. C++ may not be, either -- I will use C++ when I need to, but over the years I have become quite disillusioned about it, especially as the years go by and the C++ standards committee just keeps on piling on feature after feature, without changing the language in a major way that would break backwards compatibility and make it better. A pile like C++ is becoming will never stand for long; sooner or later it will collapse or self-destruct. C, on the other hand, will never suffer such a calamity because the pace of the committee is stable and steady. C has only had a few updates, occurring in 1978, its original year of creation, also known as K&R C; 1989, the year of standardization for the language, formally known as ANSI X3.159-1989, but more commonly as C89; 1999, which braught us C99 and its various features, including inline functions, several new data types, VLAs and FLA members, improved support for floating point operations, variadic macros, and support for one line comments; 2011, also known as C11, bringing us atomics, multi-threading, bound-checking functions in the standard library, etc.; and in 2018, which only introduces technical corrections and clarifications to the C11 standard. C++, on the other hand, has been updated quite a number of times: in 1998, 2003, 2011, 2014, 2017, and now, in 2020.
Sorry about the C/C++ history diatribe. My point is that this reinvention does not need to happen. Go ahead and do it as a learning process, but I just think its generally a bad, bad idea that will only stir up more conflict.
As for your second question, yes, it can be wrapped using C++/CLI, an extension to C++ on the .NET framework. You will need to write your own .NET wrapping APIs, however.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-17 06:42:10

I don't do it for my self, because if it were so, I'd stick with python and iron python and fuck bgt until it's truly dead, so dead that no one could use it because they would be too afraid to touch it's korps.
smile
As I wrote in the previous post, I persue the matter further only because of the people who, despite the  many limitations, don't give up bgt.
About the popularity problem, I know it and I don't  verry much chare, so, I don't want this little project  to spread much wider than this forum.
now, don't make the mistake of imagining that the new bgt wil be like the old one. For example, the sound class will have the usual properties and methods, but it would also have functions for efects and true 3d positioning.
Regarding c++/cli, could you show me an example wraping a small subset of angelscript, just to see whether is it worth it?

2019-08-17 07:58:45 (edited by Ethin 2019-08-17 07:59:17)

@11, I understand, but as I said, I personally think that continuing this, or at least publicizing it, is only going to stir up conflict and drama. But if you want to, go ahead -- I've already warned you about what I believe will happen.
As for wrapping it, no, I can't, because I don't like the AngelScript API; its far too overcomplicated and weird for me. I'd rather use the Lua C API with a C++ bridge. (Speaking of that... perhaps sometime I can try that, a Lua version of BGT. Interesting thought.)

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-17 09:22:20

bgt lover wrote:

many libraries, packages/namespaces and classes that remembering each library and function along with it's purpose is next to impossible(java). So, I decided to take the matter in my own two hands, enhancing bgt with the power of .net framework.

As if c# doesn't have a lot of packages and namespaces to remember. lol.
Not saying c# is bad, but your statement doesn't quite make sense to me.

Paul

2019-08-17 17:30:51

Offcourse it has, so many of them that sometimes I feel like smashing my head along with my laptop and the phone I use to post my recent replyes against a window, but, rather than using java, I'll choose this every day. I wander how other blind c# programmers deal with this kind of problem. Do they have an offline msdn like there once existed a .hlp file with all the windows apis for integration with the pb editor?
@12: Somewhere deep down, I hoped that you'd say that because I was'nt emotionally prepared for the headake such code would have caused.   
smile
I totally agree with you regarding the angelscript apy, that is why I prefer the iron python api or even the C python api, but I choose this because of backwards compatiblity reasons.
Regarding lua, this Seems to bea verry good idea but for one small reason:
As far as I am concerned, lua does not support oop like python does, so, the question arrises, how can I add .net classes to the environment? How does an user add classe? Are metatables the only solution? This sounds like trying to implement oop in pb using some dirty tricks.
But again, I might be wrong since verry much time passed since I last visited lua and things might change, please correct me if I'm wrong.

2019-08-17 18:58:41 (edited by Ethin 2019-08-17 18:59:04)

@14, Lua does support OOP... in a way. Via tables and all. You could go for Javascript too, if you want to embed that. (I've used the Python C API in a program before -- its not as bad as Angelscripts but pretty close.)

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-17 19:10:32

I can't use js because microsoft alreadi implemented managed js, so I will stick to ironpython or lua.
Can you think of a way to add a class to lua as a metatable, maybe using reflection?

2019-08-17 23:41:31

@16, I know how to do it in C++ using Sol2 as the bridge. I hate the Lua C API, though I should probably figure out, since I managed to conker the Python C API.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-17 23:53:21

hi,
as for your idea, My idea is go with python, and you then can use cython to write your stuff for sound management etc. but, I don't recommend you to use Angelscript, because python and lua are interpreted languages, and assume another scripting language is going to be executed on top of them (same is true with .net, though it is JIT compiled).
if you want to use Angelscript, go with C++ because it is natively compiled and you don't need some interpreted language on the background.
also you don't need to write a wrapper for it for another language as well.

2019-08-18 16:25:21

I don't use .net because I want an interpreter grinding on another one like bone on bone, this would be only as a sideeffect. I do  it because I want the users of my bgt to be able to leverage the full power of .net.
Since bgt is nothing more than a fansy c++ interpretor and as much a compiler as pyinstaller is, I choose ironpython as intherpretor unless mister ethin comes up with an example of using and registering a .net class with lua.
Does anyone know whether there is iron python for  python3?

2019-08-18 19:29:07

Lol, 19. Leveraging the full power of .NET is going to be a hell to implement. Are you seriously going to expose all of the classes and namespaces to BG? That's going to take hours, if not days, just to figure out.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-18 20:17:00

No, offcourse not , not manually atleast.
For example, I could create a function in ironpython that adds a reference to the assembly passed by name and imports * from that assembly.
This way, only some classes could be wrapped in helper classes to make life easier.
Could you please provide the .net classes in lua example? I am trying to decide between lua and ironpython, so your help would be verry appreciated.

2019-08-18 21:36:45

@21, again, I don't know how to wrap Lua in C#. I know how to do it in C++ but I have no idea how .NET classes will fair with the way I wrap classes in C++. You can't wrap namespaces, either, without wrapping all within the namespace first. ts a very complex process even with a bridge and certainly isn't fun. However, if you truly want to know how... https://github.com/ThePhD/sol2.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-08-19 00:26:07

Then, it is decided, I'll use iron python rather then trying to create a wrapper for that thing with swig.
One more question: can I create a delegate that will be able to associate itself with any function, no matter its signature like angelscript does with the global function regestering mechanism? Is the params keyword allowed in delegate definition?

2019-08-19 04:42:53

OK, here's the thing. What has BGT really brought us over the years? Not much at all. OK, Liam's BGT games were the highlight of the language in my opinion. STW and Redspot as well. Other than that, not much worth noting. Now, why would you want to allow leveraging the full power of DotNet when they can't even handle BGT without stealing code? It's ludicrous.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2019-08-19 06:33:52

I fully support this project actually.
Angelscript was never too bad to write in. BGT if actually updated correctly and leveraged with more features could be a powerful tool.
I say go for it.

Much less active on this forum than in the past.

Check out my live streams: http://lerven.me
follow me on Twitter: http://twitter.com/liamerven