Discuss Scratch

fezzinate
Scratcher
100+ posts

Has anyone made a text-based scratch code compiler?

I saw a few scratch projects acting as their own interpreters, but has anyone made a compiler that can take a text document and spits out a .sb2 file?
gtoal
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

fezzinate wrote:

I saw a few scratch projects acting as their own interpreters, but has anyone made a compiler that can take a text document and spits out a .sb2 file?

Look for “Kurt” by blob8108 which lets you edit using scratchblocks syntax. And there are others, mostly under development or incomplete.
IronBit_Studios
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

gtoal wrote:

fezzinate wrote:

I saw a few scratch projects acting as their own interpreters, but has anyone made a compiler that can take a text document and spits out a .sb2 file?

Look for “Kurt” by blob8108 which lets you edit using scratchblocks syntax. And there are others, mostly under development or incomplete.
I was originally thinking of ApuC, but that also works.
fezzinate
Scratcher
100+ posts

Has anyone made a text-based scratch code compiler?

it seems like kurt 2.0 doesn't have support for compiling like 1.4 did - but that seems exactly like what I'd be looking for.
blob8108
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

I'm working on tosh, and will hopefully have something to show soon.

Previously I wrote kurt, which had a text module which could compile a similar language. The text module is included in kurt v2. You use it like this:

p = kurt.Project()
s = kurt.Sprite(p, "cat")
s.variables["foo"] = kurt.Variable(0)
s.lists["animals"] = kurt.List(["cow", "sheep", "horse"])
s.parse("""
when flag clicked
say foo
set foo to 1
repeat 3
say item foo of animals
change foo by 1
end
""")
p.save('example.sb2')

Unfortunately kurt's text module just isn't very good. In theory it implements nearly the same language as tosh does, but in practice the kurt version has lots of bugs and edge cases which it doesn't handle well. (So there are lots of things you should be able to write, but can't.) tosh fixes those

So that's why I never got around to re-implementing the file compiler in kurt v2.

Last edited by blob8108 (Aug. 18, 2015 14:44:55)

fezzinate
Scratcher
100+ posts

Has anyone made a text-based scratch code compiler?

Tosh looks great, blob! I'm really loving your design goals and your decision to use strict “as it's read” syntax. When do you think you'll open it up publically?
__init__
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

I worked on M30W before it was abandoned
bobbybee
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

I've written an LLVM IR backend targeting Scratch, if that counts…
gtoal
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

bobbybee wrote:

I've written an LLVM IR backend targeting Scratch, if that counts…

How's that going? Any progress with either of those two demos I gave you?
gtoal
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

fezzinate wrote:

Tosh looks great, blob! I'm really loving your design goals and your decision to use strict “as it's read” syntax. When do you think you'll open it up publically?

these are all good systems but what's really needed is just a button in scratch that toggles between blocks representation and text representation. You still want the convenience of GUI sprite editing etc etc. If any of these suggested systems could be embedded seamlessly in the Scratch GUI I'd be all over them.

G
blob8108
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

fezzinate wrote:

Tosh looks great, blob! I'm really loving your design goals and your decision to use strict “as it's read” syntax. When do you think you'll open it up publically?
Thank you, that's encouraging!

When it's ready I'm nearly there, but it's not quite usable as a real product yet. Maybe a few more weeks…

gtoal wrote:

what's really needed is just a button in scratch that toggles between blocks representation and text representation. You still want the convenience of GUI sprite editing etc etc.
What do you mean by “GUI sprite editing”?

How would that be better?
liam48D
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

blob8108 wrote:

fezzinate wrote:

Tosh looks great, blob! I'm really loving your design goals and your decision to use strict “as it's read” syntax. When do you think you'll open it up publically?
Thank you, that's encouraging!

When it's ready I'm nearly there, but it's not quite usable as a real product yet. Maybe a few more weeks…

gtoal wrote:

what's really needed is just a button in scratch that toggles between blocks representation and text representation. You still want the convenience of GUI sprite editing etc etc.
What do you mean by “GUI sprite editing”?

How would that be better?
Paint editor?
TheLogFather
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

gtoal wrote:

these are all good systems but what's really needed is just a button in scratch that toggles between blocks representation and text representation.
Yes!



(I've often wished I had time to really get going on such a mod as I describe in that comment reply to blob8108 - but I decided to concentrate instead on the matching block highlighting system for now, since I thought it'd be more widely appreciated…)

Last edited by TheLogFather (Aug. 19, 2015 21:34:22)

gtoal
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

blob8108 wrote:

gtoal wrote:

what's really needed is just a button in scratch that toggles between blocks representation and text representation. You still want the convenience of GUI sprite editing etc etc.
What do you mean by “GUI sprite editing”?

How would that be better?

you know, the whole scratch sprite/costume thing. you don't really want to fall back on editing const char arrays by hand for images, do you? :-)
blob8108
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

gtoal wrote:

you know, the whole scratch sprite/costume thing. you don't really want to fall back on editing const char arrays by hand for images, do you? :-)
I was planning to add costume/sound support to tosh, eventually. So you'll be able to drag images in and use them as costumes, for example. I won't do a built-in paint editor, but then I always use an external image editor anyway!
fezzinate
Scratcher
100+ posts

Has anyone made a text-based scratch code compiler?

any updates on Tosh, Blob?
liam48D
Scratcher
1000+ posts

Has anyone made a text-based scratch code compiler?

fezzinate wrote:

any updates on Tosh, Blob?

Powered by DjangoBB