johnearnest / decker Goto Github PK
View Code? Open in Web Editor NEWA multimedia sketchpad
License: MIT License
A multimedia sketchpad
License: MIT License
Same error occurs on both decker and lilt:
razetime@razetime-Legion:~/Software$ cd Decker
razetime@razetime-Legion:~/Software/Decker$ make decker
gcc: error: _POSIX_C_SOURCE: No such file or directory
make: *** [Makefile:35: decker] Error 1
razetime@razetime-Legion:~/Software/Decker$ make lilt
gcc: error: _POSIX_C_SOURCE: No such file or directory
make: *** [Makefile:31: lilt] Error 1
OS: Ubuntu 20.04.5 LTS x86_64
So I set up a small application that returns random entries in a grid based on whether or not the user has checked a box next to each item in the grid and there are two things I've noticed that make working with grids a bit unfun.
The lists were long, so I used CSVs that I edited in Excel to populate the grids. That's not really a problem. I prefer that to building the list in the editor when one list is >100 items long.
The way I had it set up is that one column was a bool (technically 0 or 1) and the other was a string. I set the format to BL
.
However, if I made changes to one of the CSVs and tried to reimport it, it would pull the column headers, but everything else would be blank.
I later discovered that I had to remove the format that I had set, reimport it, and then reapply the format to get the desired result.
I'm not sure if this applies to all formats or just the ones I chose, but it would definitely be nice to not have to mess with a grid's format just to reimport data.
i generated some monospace fonts:
https://github.com/ktye/i/tree/master/_/i2/kui/f
files *.dek
generated with mkdek
the png files for the plan9 fonts seem to have issues.
Test is mainly opening the deck and typing some characters in fields and saving.
At around 1000 cards, the system is responsive. I am using Windows 10, 32GB RAM. The binary distribution is as downloaded from itch.io.
(Step 1) The opening time increased with the number of cards (for 6000 cards it was very noticeable running to few seconds). Step 2 is to check all the cards are opened via File -> Cards and then scrolling to the bottom and see if all the cards are opened. In all cases Decker imported all the cards. Next (Step 3) involved doing some authoring by typing some characters into the fields and saving. Saving had a performance drop when the number of cards increased. When it had about 10,000 cards save didn't succeed. The program exited on save.
Decks were generated using the python script below. Script below for reference.
header = r'''{deck}
version:1
card:0
size:[512,342]
name:"perftest03.deck"'''
field_def = r'''{widgets}
field1:{"type":"field","size":[239,289],"pos":[37,35]}
field2:{"type":"field","size":[205,60],"pos":[298,34]}
field3:{"type":"field","size":[205,60],"pos":[298,107]}
field4:{"type":"field","size":[205,60],"pos":[298,185]}
field5:{"type":"field","size":[205,60],"pos":[296,262]}'''
def generate_deck_name(count):
return "card"+str(count)
def generate_deck_header(count):
card_first_line = "{card:"+generate_deck_name(count)+"}"
return card_first_line
def generate_deck_body():
global field_def
return field_def
if __name__ == '__main__':
deck_file = open("perftest03.deck",'w')
deck_file.write(header)
deck_file.write("\n")
deck_file.write("\n")
for i in range(1,6000):
deck_name = generate_deck_name(i)
deck_file.write(generate_deck_header(i))
deck_file.write("\n")
deck_file.write(generate_deck_body())
deck_file.write("\n")
deck_file.write("\n")
deck_file.close()
The test was motivated by a video in which Bill Atkinson was talking about Hypercard being able to manage unlimited number of cards only limited by system constraints. The reasoning was that, Hypercard always read each card from disk and committed any unsaved things to the disk necessitating no explicit save. Decker deviates from this principle, though it is not bound to stick with original Hypercard ways. But, it is always good to have unlimited capacity esp a related system in the past had it as one of its main design consideration.
open any text area in Decker web and select some text
shortcuts ^c/^v/^x do not work for the selected text.
By default Decker comes with three fonts. It seems new fonts needs to be added from other decks containing (there is an example deck available in the distribution) using File -> Resources.
a. Is there a way to add system fonts easily inside Decker ? What is the preferred way ?
b. For every font size is it required to add a new font?
The documentation says
"Rich text hyperlinks are only “clickable” when their field is locked. With scripting, a link can do anything a button can do when it’s clicked, but by default if you use the name of a card as the link value, clicking the link will navigate to that card. If you use a URL, clicking the link will have Decker prompt you to open the URL in a web browser."
I tried different means to create a hyperlink, none of them succeeded. Probably I misunderstood the docs. Can you clarify how to go about creating the things mentioned in the docs (doc:"Rich Text fields can contain multiple fonts, inline images, and clickable hyperlinks.").
Or is it that these can only created by scripting?
The installer script halts if Lilt or Decker binaries are not found. Should Lilt be required or should the installer continue, just noting that the Lilt binary was missing?
Problem
This is more noticeable on my MBP with retina screen, but is perhaps an issue a cross the board.
The canvas seems to be upscaled with bilinear(?) filtering on, even though the dimensions are kept to integer scale.
The results are a slightly blurry image, in shades of grey rather than pure black and white.
Here are some zoomed screen grabs.
Currently fat bits mode can be entered using a modifier key plus click.
It would be very useful for the selection to be able to get out of fat bits mode with the same technique.
HyperCard achieved this by use of a modifier key when using the Pencil tool to toggle the mode on/off with repeated invocations.
From #3
ifeq ($(UNAME),OpenBSD)
OPEN=xdg-open
COMPILER=clang
FLAGS=-Wall -Werror -Wextra -Wpedantic -O2
# -Wno-misleading-indentation silences warnings which are entirely spurious.
FLAGS:=$(FLAGS) -Wno-misleading-indentation -Wno-unknown-warning-option
FLAGS:=$(FLAGS) -lm
# FLAGS:=$(FLAGS) -fsanitize=undefined
# FLAGS:=$(FLAGS) -fsanitize=address
endif
Packages needed:
I only tried "native" decker.
Maybe I'm stretching too far the intended use of lil or it's just another windows-specific issue but in the native version (windows wsl):
r:1 each x in 1+range 10 r:r*r*x end r
returns
583617587388727090858100711201107859493172229546854534563669836 p ~ }K Q N :~ N ` | r, ` | p ~ } Q ` | p ~ R "@ pE ` |
In the web version within decker it returns the correct result in the format: 5.83..e+224
I don't know if the intended behavior is diplaying all digits or using scientific notation.
Either way, another related question is the definition of e
as euler constant. It may trip people trying to input small or big numbers in scientific notation.
Example:
1e-3
returns
-0.281718
"%2a" parse 97
results in segfault: fish: Job 1, 'decker' terminated by signal SIGSEGV (Address boundary error)
.
Decker v1.5, Void Linux 6.0.10_1 x86_64
Decker is a great product. Really easy to use.
If you could marry markdown with this, it would be useful.
Native functions are not available in eval
, this tripped me up as I was trying to use print
and show
to get I/O helpers from an outside library earlier.
eval["print"]
{"value":0,"vars":{},"error":""}
print
on native x do ... end
eval
on native x do ... end
eval["print[\"fdssfd\"]"]
{"value":0,"vars":{},"error":""}
Problem is present in both JS and C versions.
Reproduction:
Tool → Widgets
View → Fat Bits
(do it twice)View → Show Widget Bounds
leaves it the same (no bounds).The documentation of font records states:
Decker fonts define glyphs corresponding to printable ASCII excluding the space character (33–126; 95 glyphs total), an extra glyph representing an ellipsis (for truncating text on display), (...)
There is an error in this text alone, since there are 94 characters between 33 and 126, which make 95 characters when the ellipsis is included. However the actual font data present in the source code contains 96 glyphs, including the space glyph as the first one. This causes redundancy: there's the header byte defining the number of horizontal pixels to advance for a space character, and there's a glyph record for the space character with its own specified width.
I have not yet looked at how it's handled in code, but only one of those space width declarations should stay in the format, as it may lead to inconsistencies when they differ. My preference would be towards allowing full space glyph customization.
I've decided to convert a famous 1992 Christmas animation from HyperCard to Decker. I think it would make a super 30th Anniversary surprise for the artist who is a friend of mine.
I'm happy to either keep everything to this one issue, or split it.
Currently the only real thing missing is visual effect dissolve
.
And arguably the sound playback is simpler or less versatile depending on your point of view.
Details of the project...
on mouseup
global fg
if fg is 1 then
play flute tempo 120 d3e a3e
visual effect dissolve slowly
go next
put 2 into fg
exit mouseup
end if
if fg is 2 then
play flute tempo 120 a3e d3e
visual effect dissolve slowly
go next
put 1 into fg
exit mouseup
end if
end mouseup
In Decker the lasso selection is as drawn.
It would be very useful for the selection to be only black pixels inside the drawn area.
HyperCard did this "tight" selection by default, and allowed "loose" selection (as drawn) by use of a modifier key when using the Select tool.
From #3
Request
HyperCard allowed using the modifier keys to trigger alternate drawing features and modes.
eg.
It would be cool to see them all in Decker.
Justification
The best HyperCard artists made extensive use of them. For example, I've heard this first hand from Thoru Yamamoto: https://archive.org/details/thoru-yamamoto-hypercard-stacks (viewable in browser)
HyperCard docs, see Chapter 8
Reference
If I have a field named: wanda fish
and code in a button like so:
on click do
wanda fish.text:wanda fish.text*2
end
The code will not work. I've looked through the docs for any reference to this, and tried single and double quotes, square and curly braces, and parentheses, to no avail.
Query expressions exhibit undocumented behavior, binding the table being queried to the variable x
which shadows
Run the following code in the Listener:
test_table: insert a:"x","y" b:1,2 into 0
extract x from test_table
The default value for unbound variables - 0.
A table equivalent to test_table
.
If I do something like
on click do
x:"fish"
x.text:x.text*2
end
Nothing happens. It should be possible to store a widget name in a variable and then use that to reference the widget?
This is the error:
$ liltr
d: (3,4,5) dict 4,5,6
{3:4,4:5,5:6}
table list d
rlwrap: warning: lilt crashed, killed by SIGSEGV (core dumped).
rlwrap itself has not crashed, but for transparency,
it will now kill itself with the same signal
warnings can be silenced by the --no-warnings (-n) option
Segmentation fault (core dumped)
table 3 take list d
also segfaults.
However, these cases are still fine:
$ liltr
d: "abc" dict 4,5,6
{"a":4,"b":5,"c":6}
table list d
+---+---+---+
| a | b | c |
+---+---+---+
| 4 | 5 | 6 |
+---+---+---+
d: 1 dict 4
{1:4}
table d
+---+
| 1 |
+---+
| 4 |
+---+
table (3,4) dict 4
+---+---+
| 3 | 4 |
+---+---+
| 4 | 0 |
+---+---+
Huge thanks for this awesome project! Such a creative playground!
I just set it up on Debian and noticed that the install script (install.sh
) installed lilt, but not decker as stated in the readme. No problems copying it by hand, though. I also crafted a tiny .desktop
file for myself. Is that something you would like to include in the repo or do you rather keep the packaging outside of the repo?
It would be useful to be able to quickly erase with the same drawing tool.
HyperCard achieved this by use of a modifier key when using the following tools:
But Decker combines Pencil and Brush so it would make sense to have this on the Pencil tool.
The goal here is to make for a more optimised, quicker, frictionless drawing experience.
From #3
It would be useful to be able to draw with a pattern quickly without having to use the menu.
Using a modifier toggle would be quick and easy.
HyperCard achieved this by use of a modifier key when using the following tools:
The goal here is to make for a more optimised, quicker, frictionless drawing experience.
From #3
Hi!
Firstly, this is amazing! Well done.
Problem
I've been trying the Tour on my iPhone and taps on elements like a checkbox or a button don't behave as expected.
Unfortunately this means I can get stuck and have to reload/refresh the page.
What I'm seeing
What I'm expecting
Screen recording
checkbox can't be toggled on
https://user-images.githubusercontent.com/49612/198755817-7011a5f3-cafa-41c9-822f-f0fa28aa8d95.MOV
dialog can't be dismissed
https://user-images.githubusercontent.com/49612/198756007-cda0a4e8-ca6f-496b-95d4-81b13a91fc1e.MOV
My setup
Is there any reason you have a C implementation and a JS implementation ? Won't this double the cost of long term maintenance and increase the burden of implementing new features?
You could in theory scrap the C version and use Node for desktop (Electron app etc). Or you could take the C SDL version and get it working with WebAssembly? There are lots of options out there to eliminate having two code bases.
Having a whole development environment within a single .html is absolutely amazing and so really the C version has less advantage long term. Everyone has a browser installed and so you already have a runtime environment for the .html vs C version which requires the Decker binary.
Just some thoughts.
Decker is the closest I have seen to HyperCard and would love to see it well supported and used going into the future.
I really like the idea of a nil-free dynamic type system, but numbers defaulting to zero didn't sit right with me.
It makes sense for: indexing, addition, subtraction. Concatenation shouldn't matter, because the void resolves to the empty string. But it isn't great for exponentiation, multiplication, and for division: terrible.
The solution being, for the last three contexts to resolve to 1. That would mean a missing number does nothing in the calculation, wherever found.
Just a thought! Look forward to seeing where this project goes.
When saving a deck as an HTML file via the web-decker system, it doesn't open properly again. The screen is left blank, and it appears to throw errors in the console as follows:
Uncaught TypeError: q(...) is null
Reproduction is relatively straight forward:
I'm not certain why this happens, but it appears that it is NOT the intention for this to happen.
If I import an image, then try to export an image of the selection, you just get an export of what was on the card before the import like the image isn't there. You have to drag select again to get an export that actually includes the imported image.
OS: Windows 10 64bit
Steps to recreate:
Expected Result: An image with the selected part of the card including the imported image
Actual Result: An image of the selected part of the card before the image was imported
I'm in Ubuntu 22.04, tried compiling with the optimization you sugested on the itch.io forum and with the appimage.
Thanks for this amazing software and the time to read this. :)
Reproduce:
Again, it is a how-to question. Once the Grid widget is chosen, how to populate the grid with entries ? The document is not very clear on how to do it. It talks about format string, but don't say how to add rows and columns.
A workaround is to create a csv file and DnD into the card. But, it is not efficient when you have to modify it inside Decker. Any help in this regard will be appreciated.
Decker Native-windows 1.16 / web 1.17
The "Text" menu never enables, making rich text entry difficult/impossible.
Steps to reproduce:
Text
, but it is disabledI'm not entirely unconvinced there's some other method you're supposed to use, but given that the menu appears but does not ever seem to activate...
It would be useful to duplicate the current selection.
HyperCard achieved this by use of a modifier key when moving a selection.
The goal here is to make for a more optimised, quicker, frictionless drawing experience.
From #3
The default way to record new sound leads to poor quality.
a. Is there a way to improve the sound quality of spoken voice?
b. Is there a way to import wav files from the disk?
When a command like lilt prg.lil
is run and prg.lil
does not exist, lilt
outputs a newline.
It would be helpful if it errored when given an invalid filename.
Basically what it says; the guided tour has a few fields that are a pixel too short, cutting off the descenders for letters like "g":
edit: tested this in web decker and windows native, same result
It would be useful to be able to duplicate the selection.
HyperCard (and MacPaint, Photoshop, etc) achieved this by use of a modifier key when using certain tools (Select and Lasso for HyperCard).
The goal here is to make for a more optimised, quicker, frictionless drawing experience.
From #3
This will make package maintaining for distro maintainers easier (or just third-party packagers).
EDIT minimal repro is mag 251-243
. the problem was using mag
on an atom. I read it could be used as absolute value, so i was using it here.
Implementation is C decker. JS decker works fine.
This is a WIP solution for day 7 part2 available here, the program is as follows, and the input is available at this link. The segfault seems to happen right after u
is computed.
on uniq x do extract first value by value from x end
i:"%s (%i) -> %s" parse -1 drop "\n" split read["inp/07t"]
p:() dict ()
v:() dict ()
p2n:() dict ()
each x in i
vk:x[0] vv:x[1]
pv: if x[2] ", " split x[2] else () end
v[vk]:vv
each y in pv
p[y]:vk
end
p2n[vk]:pv
end
p1:extract key where !p@key from v
show[p1]
show[p2n]
on p2 d do
if (count p2n[d])>0
vals:p2n[d]
nxt:v@vals
sums:each x in vals
a:p2[x]
show[x,a]
a
end
# show[d,p2n[d]]
# show["nxt",nxt]
# show[sums]
bal:sums
u:extract list index by value from bal
u:extract value orderby each x in u count x end asc from u
show[u]
if 2=count u
sms:bal@each x in u first x end
diff:mag sms[0]-sms[1]
show[nxt[first first u]-diff]
end
v[d]+sum bal
else
v[d]
end
end
p2[p1]
I noticed that if I select File -> Resources, browse around for a folder without usable resources (e.g. no .html or .deck files or folders available, so the Open button is greyed out), if I click Cancel to exit the dialog, the program crashes with Segmentation Fault: 11. No error report is generated.
Running MacOS 10.14.6
Steps to replicate:
Using %
on large numbers provides incorrect results. I also tried the operation without vectorization and got the same results.
a:1092455,430625591
(1092455,430625591)
m:16807,48271
(16807,48271)
a*m
(18360891185,20786727903161)
mod:2147483647
2147483647
mod%a*m
(2147483646,2147483646)
Seems to be returning a power of two every single time.
5%a*m
(2,2)
6%a*m
(4,4)
the problem seems to pop up in this range:
5%1000000000
0
5%10000000000
2
The correct answers come up on JSlil:
mod%a*m
(1181022009,1233683848)
5%a*m
(0,1)
6%a*m
(5,5)
For reference, this problem arose on on AOC 2017 Day 15.
According to Appendix 2 to Lil documentation: Binary Primitives operator +
when acting on two strings should concatenate them:
Note that using
,
on two strings will result in a list of two strings, whereas using+
will result in a single string!
Open the Listener and run query "a" + "b"
.
Listener returns the string "ab".
Listener returns the number 0.
Reproduction:
4=-1+5
0
5=-1+6
0
6=-1+7
0
-1+5
4
4=5-1
1
Encountered during aoc 2022 day 8, today.
The documentation mentions that the go[]
function takes several keywords; Next
, Prev
, First
, and Last
all have corresponding Card
menu / Action
items, but Back
is the only one that only works in scripting and isn't available as a menu item/choice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.