Recent Forum Posts
From categories:
page »
Doug Pederson SpectateSwamp (guest) 12 Jun 2017 13:35
in discussion Hidden / Per page discussions » In the Defense of Spaghetti Code

Spaghetti code is fine if you can flowchart.

Structure this if you can.
This is the flowchart for my search engines text display - hi-lite and line wrap etc
The source code is at:
Being able to flowchart has saved my bacon a number of times.

by Doug Pederson SpectateSwamp (guest), 12 Jun 2017 13:35
by Fritz (guest), 01 Jun 2017 23:38
Lame-R (guest) 25 May 2017 22:28
in discussion Hidden / Per page discussions » On printing money

You loan me 5 coins you're now out those 5 coins until I pay them back somehow, plus the 1 coin interest we agreed upon. No money was created. Now if somebody comes along and offers to buy that "IOU" note I gave you for 6 coins you can have your money back and let me owe them. Still no money was createdthey're out 6 coins but expecting that back from me any day now. It's not until you get into fractional-reserve lending that money is created. Then it's essentially virtual moneya tangible artifact of an intangible concept: trust. That's ok, though, because the money supply shouldn't be finite—not only is population growing, but so is the value that everybody creates. The problem occurs when it gets out of hand.

At least that's how it all seems to my mind.

by Lame-R (guest), 25 May 2017 22:28

If we always tell that people will not learn language A , we will never make progress.

It would be better to build such a tool but then provide examples of more advanced languages that have already solved these problems.

Some will use the tool, others will learn a better language which will be much better in the end.

by Apostolis (guest), 11 May 2017 10:57

Resembles miniKahren[1] and Clojure/core.logic[2] quite a lot.


by Vag (guest), 02 May 2017 16:21

I like actually like prolog, I wish that paradigm was used more and I think it makes sense in this setting. Fortunately you still get some prolog-like benefits in JS with inheritance and the getter syntax. Prolog style input with JSON as an output might be accessible though.

by ash (guest), 01 May 2017 14:28
by martin_sustrikmartin_sustrik, 01 May 2017 10:34

You have a typo: "to explore the machanics ". Feel free to delete this comment once fixed.

by Alvaro (guest), 01 May 2017 09:58, seems to do cartisian/relational programming Isn't this essentialy what Eve is?

by Zubair (guest), 01 May 2017 08:41

Here's the testsuite example rewritten to SQL. I don't know how to model the inheritance relationship though:

SELECT 'box1' AS hostname, 'linux' AS os, 'x86-64' AS arch, 8 AS ram UNION
SELECT 'box2', 'freebsd', 'arm', 16 UNION
SELECT 'box3', 'windows', 'x86-64', 4 UNION
SELECT 'box4', 'illumos', 'sparc', 4;

SELECT 'gcc' AS binary, '4.8.4' AS version, '-o' AS output_option UNION
SELECT 'clang', '3.4.1', '-o' UNION
SELECT 'msvc', '15.00.30729.01', '/Fe';

SELECT 'frobnicate' AS name, 'frbonicate.c' AS sources UNION
SELECT 'loadtest', 'loadtest.c helpers.c' UNION
SELECT 'end2end', 'end2end.c helpers.c';

CREATE TEMP view testsuite AS
SELECT *, compilers.binary || ' ' || tests.sources || ' ' ||
    compilers.output_option || ' ' || AS cmdline
FROM boxes, compilers, tests
WHERE NOT( = 'loadtest' AND boxes.ram < 8);

SELECT * FROM testsuite;
by martin_sustrikmartin_sustrik, 01 May 2017 08:25

Ack. I've been thinking a lot about Prolog while contemplating the problem. But in the end, I think, most programmers would just not use Prolog (too exotic) while they may be OK with JavaScript.

by martin_sustrikmartin_sustrik, 01 May 2017 05:46

You can to similar things in PostgreSQL, which has the notion of literal tables (not standard SQL though). Instead of declaring variables you can create views. Nested types and inheritance may prove problematic to implement in SQL though.

But all it all, I think you are right: What I called cartesian programming is more or less relational programming, albeit with the focus on generating data rather than querying data.

Here's the code in this article translated to SQL:

SELECT 'newyork' AS name, 7 AS webservers UNION
SELECT 'london', 4 UNION
SELECT 'tokyo' , 2;

SELECT *, webservers * 10 AS backends
FROM datacenters;

SELECT name AS datacenter, '/usr/bin/webserver' AS cmdline, webservers AS instances 
FROM plan;

SELECT name AS datacenter, '/usr/bin/webserver' AS cmdline, backends AS instances 
FROM plan;

SELECT * FROM backends;

The clarity of expression is lacking, but, algorith-wise it does the same thing.

by martin_sustrikmartin_sustrik, 01 May 2017 05:30

So what's the Baconian paradigm that complements this?

by owen (guest), 01 May 2017 00:43

The concept seems closely related to the “constraint programming” paradigm — more specifically, with finite domains. You declare a set of variables, each one taking its value in some finite domain. A program in this paradigm describes a set of assignments of these variables. It uses constraints to do this. If there is no constraint, then the “output” of the program is the whole Cartesian product. Constraints eliminate some assignments: by declaring “x == y * 2’, you're eliminating all assignments in which x and y do not satisfy the equality.

The CP frameworks I used did not feature struct-like objects as in your examples, but I suppose there are some that do. I'm not saying it's exactly equivalent to what you described in this article, but there are interesting similarities, and I think it's worth mentioning.

by Alexandre Niveau (guest), 30 Apr 2017 15:57

Does SQL match your notion of Cartesian paradigm? It's declarative (not procedural or functional), and works over sets. The "larger scope" would be the whole set of data; the "smaller scopes" would be projections, selections, etc.

by B. K. Oxley (binkley) (guest), 30 Apr 2017 15:42
ixy (guest) 27 Apr 2017 05:47
in discussion Hidden / Per page discussions » Why is my TCP not reliable (expert edition)

Since the client has not received an ACK for its packet, shouldn't it wait for it anyway? After all, the FIN and ACK could always have been reordered in transit, so the ACK could still be coming.

by ixy (guest), 27 Apr 2017 05:47
Sean Conner (guest) 18 Apr 2017 05:06
in discussion Hidden / Per page discussions » Why is my TCP not reliable (expert edition)

Would using two descriptors for a binary stream (TCP) work, as mentioned in ?

by Sean Conner (guest), 18 Apr 2017 05:06

Because FIN means that server has closed the server->client half of the connections. No more bytes are going to arrive.

by martin_sustrikmartin_sustrik, 14 Apr 2017 06:11
Dan (guest) 13 Apr 2017 13:37
in discussion Hidden / Per page discussions » Few thoughts on current political situation

I noticed this blog talks about technology a lot, so let's phrase this in technology terms. How about running society in a fully distributed fashion? There's about 477 million people in North America. It's like a 477M core CPU!

We can distribute to all those CPU cores all sorts of tasks:
1. What should I eat? (get rid of farm subsidies.)
2. How should I educate my kids? (get rid of local/state/federal taxes for education.)
3. Where do I find the funds to provide housing? (get rid of HUD, Fannie Mae, tax breaks for mortgage interest.)
4. Etc.

By the time you eliminate the central command and control megalomaniac OS (taxes and regulation) there will be so many resources available we'll have much more prosperity as a whole.

Of course, some CPUs will screw up. That's what private charity is for (another massively distributed system that also does not need a central command and control system.)

by Dan (guest), 13 Apr 2017 13:37
Rajiv Ram V (guest) 12 Apr 2017 19:53
in discussion Hidden / Per page discussions » Why is my TCP not reliable (expert edition)

"But look at the client now: It's waiting for responses and considers incoming FIN to mean "no more responses". But, actually, there were responses! It was just the server was unable to send them."
How can the client assume that there were "no more responses" when it hasn't gotten an ACK back?

by Rajiv Ram V (guest), 12 Apr 2017 19:53
page »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License