10 ms·
Table-oriented programming (2002)
- dang 10y agoThere was one previous discussion in 2009: https://news.ycombinator.com/item?id=892163 https://news.ycombinator.com/item?id=892163.
- Animats 10y agoTable-oriented programming needs more tables and less code. Think spreadsheets, and systems with functional boxes interconnected by lines. Examples are LabView and Blender game programming. Incidentally, the box with all the knobs is an art piece by Miller Levy, not a functional device. Here's the original.[1] [1] http://www.millerlevy.com/ http://www.millerlevy.com/
- wvenable 10y agoWe need spreadsheet oriented programming. A lot of people use Excel for all kinds of programming but it gets pretty complicated. Even something as simple as being able to name a column or a cell could go a long way towards improving these Excel programs.
- wnoise 10y agoYou already can name cells in Excel, and use those names as references, rather than B5, or whatever. https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4d0f13ac-53b7-422e-afd2-abd7ff379c64 https://support.office.com/en-us/article/Define-and-use-name...
- lightbendover 10y agoAlmost every B2B venture eventually recreates Excel so I'm inclined to agree with you. A popular (and good) common methodology would go a long way.
- fiatjaf 10y agoI'm not a B2B venture, but I've reacreated Excel: https://share.sheets.ninja/ https://share.sheets.ninja/
- fiatjaf 10y agoSee https://www.youtube.com/watch?v=0nbkaYsR94c https://www.youtube.com/watch?v=0nbkaYsR94c
- siddboots 10y agoMany people, including Microsoft, have tried and failed extrapolate on spreadsheeting towards a more general purpose programming environment, and it turns out to be very hard. A 2D grid of editable cells without a type system makes for a great scratchpad environment, but those features are also a barrier for abstraction.
- Swizec 10y ago> A 2D grid of editable cells without a type system That sounds like a big improvement on the model we all use every day: a 1D grid of editable memory locations without a[n inherent] type system.
- bbcbasic 10y agoWho uses such a model? Unless you write assembly language?
- taneq 10y agoThe reason this keeps failing is that people don't want to do programming in Excel. They definitely don't want to do general purpose programming in Excel. They just want to use some formulas to calculate some things. Of course, what they're doing is programming, but the genius of spreadsheets is that it lets "non-programmers" program while hiding from them the fact that they're programming.
- ams6110 10y agoLotus Improv did this in the early 1990's. Improv was an attempt to redefine the way a spreadsheet program should work, to make it easier to build new spreadsheets and to modify existing ones. Conventional spreadsheets used on-screen cells to store all data, formulas, and notes. Improv separated these concepts and used the cells only for input and output data. Formulas, macros and other objects existed outside the cells, to simplify editing and reduce errors. Improv used named ranges for all formulas, as opposed to cell addresses. https://en.wikipedia.org/wiki/Lotus_Improv https://en.wikipedia.org/wiki/Lotus_Improv
- threepipeproblm 10y agoImprov was too good for people to take. Quantrix reproduces most of that functionality today.
- nevdka 10y agoExcel can name columns using tables. Tables make Excel much nicer to use for complicated things.
- garyclarke27 10y agoAgreed - I'm a heavy Excel user and I use tables for 90% of data. Tables enforce unique column names, what is missing is the same for unique row names or ids plus an easier way to relate rows, without having to use index match everywhere, which soon becomes a real pain in the arse. A separate me product - power pivot does something like this - ms needs to add this as native functionality to Excel, since normal pivot tables are so unflexible, I never use them anymore.
- VladimirGolovin 10y agoThe biggest problem with spreadsheet-oriented programming is that we haven't yet found the way to abstract table sections into reusable 'functions', which currently leads to tons of copy/paste. There was a proposal to add user-defined table-based functions to Excel, by a group of authors including none other than Simon Peyton Jones, a major contributor to Haskell and GHC. Here's that paper: http://research.microsoft.com/en-us/um/people/simonpj/Papers/excel/ http://research.microsoft.com/en-us/um/people/simonpj/Papers... Curiously, the paper is titled 'Improving the world's most popular functional language: user-defined functions in Excel'. (And by the way, you can already name and refer to any range of cells in Excel, not just a row or a column. There's also a GUI dialog that lets you manage the names, e.g. rename, delete etc.)
- digi_owl 10y agoI wonder if functions, or their equivalent, is what makes programming complicated for many. Because now you have one set of code that crops up in multiple places, and have different states depending on how it gets used in those locations. The reason people reach for spreadsheets seems to be because they are visual. much like the register panel "blinkenlights" on early computers, spreadsheets allows someone to glance across and check the state of things. And in an earlier discussion about this, someone pointed me to Apple's Numbers spreadsheet. There you can have multiple freely moveable and expandable sheets on screen at the same time, each addressable via its own name.
- fsloth 10y agoEfficient syntax for set operations and enabling and exposing relational algebra as simple constructs usually simplifies code (I do lot of data transforms at work). It does not require fancy constructs, just starting from the fact that a large category of programs can be expressed succintly with relational algebra and then implementing the clearest and most succint code to implement it.
- jfoutz 10y agoThe one place this style has been handy (for me) was managing gui actions. Imagine some code to save a file. That code should be activated on a few different events, CTRL-S, File -> Save, perhaps a save icon on a toolbar. You want a 4 way associative set. A key event comes in, lookup the action for that event in the table, SELECT action FROM bindings WHERE key=CTRL_S; (or whatever). I didn't really use a database, but it gets the concept across. This style makes it really easy to dynamically add buttons for actions, verify you've got shortcut keys for different actions, things are hooked up in menus, things like that. IMHO, it's of limited value. On the other hand, any time you've got several maps that all need to stay in sync something more table like is really nice. A map and it's inverse, several maps all pointing at the same values, things like that.
- zwieback 10y agoVoted this up out of pure nostalgia. I remember the "spirited" usenet discussions we had with topmind/tablizer on comp.object. He was a one-man army fighting proponents of OO. There were actually some decent ideas buried in his ramblings about table-oriented programming but he was so abrasive nobody could deal with him. I'd be curious what became of him...
- jvoorhis 10y agoWhen I saw the headline I immediately thought of http://c2.com/cgi/wiki?TopMind http://c2.com/cgi/wiki?TopMind
- to3m 10y agoI remember him from the late 1990s, I think. One of the various usenet weirdos I have somewhat fond memories of reading at the time. "Wow, who the hell were those freaks", I'd think, as I left a computer room at university, blinking at the sunlight (since the room I'd usually go to, on account of its good-sized set of underused HP9000s, had slightly dim lighting and zero windows), having just spent half a day of one of what would have been potentially the better years of my life reading what these people had to say. How could they find the time, I'd wonder. Didn't they have anything better to do? ;) Still fascinating though. Usenet was like a crash course in seeing how people can be dicks. Still can't decide whether I regret it or not.
- digi_owl 10y agoBy late 90s, eternal september had set in. Meaning that anyone with AOL access could access usenet. the net has likely never recovered.
- radarsat1 10y agoIs there a modern language built on these (or similar) principles? Just curious. I imagine a DSL would be adequate, but it seems we still use SQL and OOP most often, with the exception of array languages. (These days even my array programming is in an OOP language, Python) Not to say that this is necessarily a better idea, but I find it interesting enough to wonder what analogous things are out there right now. Aside: I find this a neat example of some hidden knowledge buried in the historical web that could easily have been lost if it weren't for brave internet archivists. Kudos to the internet archive et al!
- talideon 10y agoThe closest thing I can think of that's still in use is Visual FoxPro.
- Zuider 10y agoThe article claims that the following languages are table oriented in some respect: "TOP languages do exist in various levels or incarnations of Table-orientedness. These include Xbase derivatives (dBASE, FoxPro, Clipper), PAL (Paradox), Power-Builder, Perl (for certain list types), Progress, Oracle's PL/SQL, and Clarion Developer." A quick web search shows that all of these are apparently still actively developed and used. I don't think any one is modern in the particular sense I understand your question since, apart from Perl, they were all attempts to create the fourth generation languages that were supposed to take over from structured programming.
- co_dh 10y agokdb+/q is table oriented, or array oriented.
- stcredzero 10y agoCouldn't you just call Lua "Table Oriented Programming?" Everything is a table, from which you can construct things like an object system.
- lokedhs 10y agoOr even APL, where everything is an array (with an arbitrary number of dimensions). For example, adding two arrays together will add the corresponding elements.
- fit2rule 10y agoIndeed, you can use Lua tables within an object-oriented paradigm, or you can use them for other things as well. The power is in metatables, which allow you to alter the behaviours of table operations according to your needs. So in that sense, Lua allows table-oriented programming indeed.
- barrkel 10y agoTables are a fine way to explore the testable state space of moderately complex functions where there's natural or explicit discrete points in each dimension / argument. It's easy to see which combination is or isn't tested when it's in a tabular form, vs almost any other approach. For actually driving logic, it tends to be somewhat user unfriendly unless there's something intrinsically table-oriented in the domain. The best table-oriented program I ever worked with was a disassembler; naturally, machine code (particularly the x86 series) lends itself to tables since unused / reserved opcodes in one generation turn into prefixes in the next. Tables do make explicit the entire state space, though, and if followed to the logical cross-product extreme, are agnostic to the hierarchy imposed by OOP. But the geometric space explosion of cross-products makes you want to create new abstractions to cover more ground, and you start to lose what tables gave you to begin with.
- vmorgulis 10y ago> But the geometric space explosion of cross-products makes you want to create new abstractions to cover more ground, and you start to lose what tables gave you to begin with. What kind of abstractions are you thinking of? ORM? There is an interesting comparison between tables and s-expression on c2.com that might interest you: "The average for TOP is higher than es-exp's in my opinion, so they are the better general-purpose tool, especially if complexity of a project grows over time. I rarely see project complexity shrink over time, thus it seems more logical to emphasize the higher end when making a judgment rather than the lower end. If you see dark clouds on the horizon, you should pick the bigger umbrella even though the current rain may be light. -- top " http://c2.com/cgi/wiki?AreTablesGeneralPurposeStructures http://c2.com/cgi/wiki?AreTablesGeneralPurposeStructures
- barrkel 10y agoI'm thinking of functions with many arguments: every argument adds an extra dimension to the table. Even if you unwrap the dimensions (e.g. instead of a cube made of 1/2, a/b and x/y, you have a table of a1/b1/a2/b2 vs x/y) you still multiply the state space. S-exprs are simply a representation for trees, and you can use trees for anything - not necessarily the most efficient way, but trees are very flexible. But trees encode policy: the choice of root and branch determines what's cheap and what's expensive. Tables are agnostic, but they pay for their agnosticism with their dimensionality.
- pedasmith 10y agoThe RS/1 statistical system used a table-based approach; it was wonderful! If I ever spend time to design a language, it's going to have "table" as the main non-primitive type, with some "hints" to sallow super speed. Cool features: tables could be much larger than memory; they were swapped out as needed. Temporary tables would just stay in memory until memory pressure grew too high; then they were automatically spilled to disk. What in unix are weird-looking files (termcap, I'm looking at you!) were just tables of data. Unlike SQL table, RS/1 simply let you change tables using a nice editor (or via SQL-like commands). Also unlike SQL tables, RS/1 tables should be grouped into objects; an XY graph was simply a collection of tables (a data table, a table for options like line color, some ticks tables, and more). Normally you edit a graph using a nice editor, but you could also edit the (documented) underlying tables. Overall, it was the single most productive programming and data manipulation environment (for it's time) that I've used.
- jloughry 10y agoI can't believe nobody has invoked Fred Brooks yet, so I'll do it: "Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need your flowcharts; they'll be obvious." The Mythical Man-Month (1975)
- dahart 10y agoOne of the rogue work projects I took on once that I'm still proud of was baking Excel tables into a memory-mapped block in a game engine, and having a very lightweight API for reading the table. That makes it super easy to author state machines using Excel with arbitrary data per state. Super useful and provided a great way for designers to do the game logic in Excel while I focused on the physics or whatever else. It was also orders of magnitude faster than any other format the studio was using for data - XML was truly disasterously awful, but even decent formats would be doing parsing, translating, copying and memory allocation per node from whatever file format they were using. Compare that to a table that is ready to go in memory after a single fread(). I still wouldn't call it Table Oriented Programming, nor suggested that it is somehow opposed to Object Oriented Programming, but I do have experience to back up how some of the ideas in this article are good.
- co_dh 10y agoCan you provide more details on how do you baking Excel tables into a memory-mapped block? did you used memory mapped file as in linux? or you manually synchronize between excel and a memory block in game engine?
- gwbas1c 10y agoOne of the projects that I worked on failed miserably because the leads drank so much OOP kool-aide that they just couldn't conceive of table-oriented techniques when needed. Updated Requirements dictate that we need to add a field? Just spend a few days adding the same field to 20 different classes and converters! UI team asks that our REST APIs allow them to filter fields? One of the lead's head exploded because he couldn't conceive how to do that without strongly-typed objects.
- JoeAltmaier 10y agoI'm wondering why there's no table-based computer language, is there? We have string-based, functional, list-based, object-based. Why not one where conditionals, even arithmetic is a table lookup? Could execute terrifically fast if tables were small enough to fit into memory.
- dboshardy 10y agoIt's not quite table-based, but APL [0] uses multidimensional arrays as it's main datatype. [0]: https://en.wikipedia.org/wiki/APL_(programming_language) https://en.wikipedia.org/wiki/APL_(programming_language)