Hacker News new | ask | show | jobs
by mathgladiator 1902 days ago
This is near and dear to my heart since Excel is a great platform, but you can't just slap Excel in a server (for most apps).

Being reactive was a core design decision with my programming language ( http://www.adama-lang.org/ ), and it simplifies my life greatly. I treat the back-end like an Excel sheet that I can send messages to, and the server will ingest those messages into some data changes (typically table changes), and then all the formulas that depend on those sources of data get recomputed.

Since, I'm using websocket, I can leverage knowledge of the prior state and just send deltas down to the client. It's super efficient, and I'm having great velocity with just manually data binding DOM elements to a giant reactive document.

Beyond the current market of board games, I have an ambition that I'll scale it out of the current niche to compete with spreadsheets. I'll probably turn the infrastructure into an open source firebase like product. Not sure yet.

3 comments

> but you can't just slap Excel in a server.

There was this company I worked for, that realised the customers (insurance biz) had a lot of proficiency in Excel, and basically half of the use case of the biz was converting these spreadsheets into web apps. Of course this a) takes a lot of time and b) isn't very agile in face of spreadsheet updates.

So my idea was to process the spreadsheet as follows:

    - list the output cells
    - list the input cells
    - parse the formulas
    - walk from the output cells to the input cells
    - use the resulting graph to transpile the spreadsheet
Can you imagine the consequences of the resulting transpiled artifacts. Source control. Diffs. Conformance tests. And more.

So I got it to an Excel+OpenDocument formula parser plus essential standard library, an AST and prototype transpiler into Ruby and Go, ready to bundle in your monolith or run in a lambda.

The thing was shot down because "If we build this, how could we bill our customers big $$$ for non-work? This would drive our gross income down, so we'd put ourselves out of business!".

Right.

And now the IP is owned by that shitty company, which sits on it to extract cash for customers.

I wrote something like that many years ago using OpenOffice format which is basically XML, and then I translated to PHP. (http://jeffrey.io/wall-of-shame.html KaPowie)

If I didn't have so many different ideas, then I'd love to return to it.

Ultimately, I'm realizing if I want to storm this market, I need to create a successful revenue engine to explore the space. How I would do it now is provide two hacks:

(1) special format for tagging regions within the spreadsheet as either tables, objects, or values with static types.

(2) a wizard to walk through the transpilation to provide guidance and look into oddities in the sheet.

The purpose of (1) is to automate the tagging process in (2), and the key is to turn the process into a predictable game so you can move back and forth easily. Now, if you transpile from Excel/OpenSheet to Adama, you not only have source control but a reactive database with full history and auditability.

MS slapped Excel in a server : I remember developing a webapp with a backend which calculated ... things ... through an embedded, user-supplied Excel sheet.

If it was Sharepoint or pure .NET, I don't recall.

i browsed through the adana blog a bit, and it was refreshing to see a discussion of canvas vs accessibility! far too often no one thinks about that.
As I age, I realize the importance of it based on people I know.

I am pondering two things at the moment.

(1) how to introduce high contrast for important details. There is a lot of cosmetic noise in board games, and I'm looking at how to rendering JSON into an image. What annotations can guide this rendering such that important details are more obvious.

(2) of what I'm looking at, what is the (a) important stuff right now and (2) what happened. If I can make it easy to describe the picture with words, then not only can I solve the problem for blind people but I can bring home assistants into the picture.

For (2), I can solve (a) easy enough. For (b), I'm still sorting that out since I am playing with my hands behind my back. Like, I can describe things as "cards entered your hand" or "cards left your hand", but I'm struggling to figure out how to distinguish between "you got two cards from the deck" versus "you took a card from Zem into your hand". Similarly, I'm having the same problem as "you trashed a card" versus "you discarded a card", and I'm struggling with the in-between for animation. The core reason for this problem is that the client just sees an array changing in elements, and I don't know the origin or destination for those elements. My hope is that if I can solve this, then I get both the change-log and animation within a unified idea.

is it too expensive to send an event log to the client and have it be replayed? i did that for a stateless scrabble bot and it worked out pretty well, the bot got an event log from the server, replayed it to construct a board position, and sent back a move which was added to the event log sent to the other player.
that's what I am doing, but my events are data transformations with zero game-context. For instance, I have an array that goes from [1,2,5,7] (card ids in your hand). I will know that array will change into [1,2,5], and that's great. However, why did it change? Did I play a card? was a card taken from my hand? Did I trash a card?

The immediate problem is how do I animate the card going away? The next question is how do I convert that to text like "You drew a card" versus "You stole a card from player X"

Now, ideally, I want to make this very simple and also privacy respecting as well. I can hack the card animation problem directly by having the UI detect connect the dots between cards appearing and being orphaned. This may be good enough for many scenarios.

Another thing I'm thinking about is contextualizing the events the client sends (which do have more domain context). This is probably the right way to go, but this adds a new layer to think about.

it would work better if the event was something like "PLAY, played=7, drawn=K, trashed=K, hand=[1,2,5]" with the client perhaps validating that applying the play does lead to the hand [1,2,5] as an error correction mechanism.

you need to make sure not to leak information about one player's hidden moves to another player, of course, but in general i would say have your events be as rich as possible so that clients can interpret them for animations, screen reading etc.

edit: for reference, this is the format scrabble programs have standardised on for their event log: https://www.poslfit.com/scrabble/gcg/