This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-12-21 16:35:01

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

DLL interface?

Just thinking of making something but I need a bit of help.
My question is simple:
How can I interface the scratch source to call DLL functions? I don't know much about dlls but I have read the scratch plugin source and understand how they are made. I plan on making one with python.

Last edited by midnightleopard (2011-12-21 16:55:36)


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#2 2011-12-22 07:01:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: DLL interface?

you can't compile python into machine code  wink

Offline

 

#3 2011-12-22 12:27:23

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: DLL interface?

roijac wrote:

you can't compile python into machine code  wink

you can, you just need an external application.

Offline

 

#4 2011-12-22 15:58:24

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: DLL interface?

All seriousness, someone competent please answer my question.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#5 2011-12-22 16:15:13

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: DLL interface?

In short, you can't. DLLs are files that are specific to Windows. Python can be run on Windows, Mac, even Linux. You would have to get a special compiler that is able to compile python into machine language. This is no simple task, and I do not know whether such a compiler exists. Even if one does, you would still have a better, easier, more efficient, and more capable approach if you just wrote one in C or C# (C sharp)

-bobbybee


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#6 2011-12-22 18:32:33

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: DLL interface?

http://images.cheezburger.com/completestore/2011/12/22/2373f823-78c2-49c1-ab10-d0e9a22deae8.jpg
I can make it with C, who even cares. I just want to know how to INTERFACE DLLS WITH SQUEAK.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#7 2011-12-22 19:45:01

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: DLL interface?

In that case, I can't help you  sad  (and the picture is scary)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#8 2011-12-23 05:09:58

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: DLL interface?

Offline

 

#9 2011-12-23 10:13:25

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: DLL interface?

bobbybee wrote:

The picture is scary.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#10 2011-12-23 13:49:57

jimmyscratchlab
Scratcher
Registered: 2010-07-15
Posts: 45

Re: DLL interface?

FFI, the Squeak Foreign Function Interface, is used to call functions located in shared libraries that are not part of the Squeak VM nor its plugins.
http://wiki.squeak.org/squeak/1414

Offline

 

#11 2011-12-23 16:56:53

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: DLL interface?

jimmyscratchlab wrote:

FFI, the Squeak Foreign Function Interface, is used to call functions located in shared libraries that are not part of the Squeak VM nor its plugins.
http://wiki.squeak.org/squeak/1414

roijac wrote:

here you go

Finally. Thank you.
http://images.icanhascheezburger.com/completestore/2009/5/9/128864031496867594.jpg


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#12 2012-01-03 14:20:11

jimmyscratchlab
Scratcher
Registered: 2010-07-15
Posts: 45

Re: DLL interface?

My FFI(Foreign Function Interface) testing
http://jimmyscratchlab.blogspot.com/201 … ltalk.html

Offline

 

#13 2012-01-03 14:57:19

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: DLL interface?

bobbybee wrote:

In short, you can't. DLLs are files that are specific to Windows. Python can be run on Windows, Mac, even Linux. You would have to get a special compiler that is able to compile python into machine language. This is no simple task, and I do not know whether such a compiler exists. Even if one does, you would still have a better, easier, more efficient, and more capable approach if you just wrote one in C or C# (C sharp)

-bobbybee

Or VB  smile


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#14 2012-01-03 18:36:04

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: DLL interface?

DAFFY22!!! Seriously, though  smile


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#15 2012-01-04 03:16:12

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: DLL interface?

bobbybee wrote:

DAFFY22!!! Seriously, though  smile

Vb and c# are very similar languages. I learnt vb by learning c# first.  smile


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#16 2012-01-04 17:56:56

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: DLL interface?

jimmyscratchlab wrote:

My FFI(Foreign Function Interface) testing
http://jimmyscratchlab.blogspot.com/201 … ltalk.html

never thought a weird website in Chinese could be so helpful.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#17 2012-01-05 15:55:55

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: DLL interface?

well, i got it ^^
stop being so annoying

Offline

 

#18 2012-01-05 16:06:38

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: DLL interface?

bobbybee wrote:

In short, you can't. DLLs are files that are specific to Windows. Python can be run on Windows, Mac, even Linux. You would have to get a special compiler that is able to compile python into machine language. This is no simple task, and I do not know whether such a compiler exists. Even if one does, you would still have a better, easier, more efficient, and more capable approach if you just wrote one in C or C# (C sharp)

-bobbybee

*loud breath*
NO.
USE C++  smile


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#19 2012-01-05 16:12:46

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: DLL interface?

B, C, C#, C++, Objective-C, Objective-C++, D, D++ -- eh, it's all the same.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#20 2012-01-05 19:20:03

midnightleopard
Scratcher
Registered: 2007-09-13
Posts: 1000+

Re: DLL interface?

bobbybee wrote:

B, C, C#, C++, Objective-C, Objective-C++, D, D++ -- eh, it's all the same.

Don't try diving into C right after learning C++. They are surprisingly different, and I prefer C++. My extension will likely be written in C++.


http://pwp.wizards.com/5103673563/Scorecards/Landscape.png

Offline

 

#21 2012-01-06 03:40:06

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: DLL interface?

Or vb.net!!  tongue
Joking, c++ is good because you could also compile it for macintosh. So more scratchers will be able to use it.  smile

Last edited by Daffy22 (2012-01-06 03:40:27)


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#22 2012-01-06 06:37:21

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: DLL interface?

I know, I just mentioned it because I learned C as my first (real) programming language.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#23 2012-02-23 08:06:53

asimov1981
New Scratcher
Registered: 2012-02-17
Posts: 10

Re: DLL interface?

I have a similar Problem (with a existing dll), did you found a good Tutorial or something?

I didn't find the discussion if a dll shoulb be written in C++, C or whatever not so helpful in regard of the primal post.

Offline

 

#24 2012-04-23 17:31:16

Nathanator1416J
Scratcher
Registered: 2012-02-21
Posts: 100+

Re: DLL interface?

Really! I learned C# by learning VB!
But back to the point!
Its very simple to interface dlls with scratch/squeak.
Me and my friend are making a mod of scratch that imports a dll and uses each function and sub as a block. Anyone wanna help?


http://wiki.scratch.mit.edu/images/Ptp.gif PEPPERTREE  Productions (PtP)
Tourmaline Scientific Research Programs

Offline

 

#25 2012-04-23 17:33:23

Nathanator1416J
Scratcher
Registered: 2012-02-21
Posts: 100+

Re: DLL interface?

If you want to, just email me at [email removed by moderator]

Last edited by sparks (2012-04-23 17:50:47)


http://wiki.scratch.mit.edu/images/Ptp.gif PEPPERTREE  Productions (PtP)
Tourmaline Scientific Research Programs

Offline

 

Board footer