YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Squirrel.NET binding
cartman300
#1 Posted : Saturday, July 19, 2014 3:58:36 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/19/2014(UTC)
Posts: 3
Location: Croatia

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hello, i'm a quite new Squirrel user and i have to say the language API is cleaner and more functional than the Lua API and it comes natural to me because i'm quite familiar with the Lua API, but i don't really use C++ or C a lot so i was searching for some .NET binding for Squirrel but couldn't find any so i wrote one.

GitHub

It's written in C++/CLI and compiles to a single dll named SquirrelNET.dll (there's a prebuilt one in bin directory), it includes the unmanaged version of Squirrel in itself so it's just one dll dependency when embedding instead of the language dll and a wrapper.
Here's a C# example.

fagiano
#2 Posted : Saturday, July 19, 2014 8:21:04 PM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,059

Thanks: 0 times
Was thanked: 79 time(s) in 61 post(s)
very cool, It might just be something I could use for my current project.

thank you
Alberto
Follow me on Twitter @squirrellang
1 user thanked fagiano for this useful post.
cartman300 on 7/20/2014(UTC)
IndigoFuzz
#3 Posted : Tuesday, September 22, 2015 9:07:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/22/2015(UTC)
Posts: 2
Location: United Kingdom

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Excellent work :) Could you please however provide an example for retrieving a string parameter when a C# function is called in .NET

I'm struggling to retrieve it using sq_getstring(*) as there seems to be a huge conflict of encoding.

Kind regards
cartman300
#4 Posted : Thursday, September 24, 2015 6:51:49 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/19/2014(UTC)
Posts: 3
Location: Croatia

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
IndigoFuzz wrote:
Excellent work :) Could you please however provide an example for retrieving a string parameter when a C# function is called in .NET

I'm struggling to retrieve it using sq_getstring(*) as there seems to be a huge conflict of encoding.

Kind regards


What kind of conflict? Everything seems fine for me.


IndigoFuzz
#5 Posted : Friday, September 25, 2015 11:16:57 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/22/2015(UTC)
Posts: 2
Location: United Kingdom

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
You are right, I was trying to retrieve a string from the wrong slot when querying arguments for a native C# function call.

May I ask if you intend to add the missing functions like SetNativeClosureName and GetNativeClosureName to your branch?

Again, excellent work and I can see this being extremely useful.

Kind regards
cartman300
#6 Posted : Friday, September 25, 2015 5:33:19 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/19/2014(UTC)
Posts: 3
Location: Croatia

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
IndigoFuzz wrote:
You are right, I was trying to retrieve a string from the wrong slot when querying arguments for a native C# function call.

May I ask if you intend to add the missing functions like SetNativeClosureName and GetNativeClosureName to your branch?

Again, excellent work and I can see this being extremely useful.

Kind regards


I plan on rewriting that eventually from scratch in C# to P/Invoke the functions from a native dll so it doesn't have to be recompiled for each new version of squirrel that's API compatible, but now that you mention it i don't know why i didn't make bindings for everything. Open a new issue on github for each missing function and i'll add them as i come around.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.095 seconds.