Recent Forum Posts
From categories:
page 1123...next »
Brian Oxley (guest) 22 Feb 2019 01:46
in discussion Hidden / Per page discussions » Tiles: Report on Programmatic Code Generation

What do you think of Perl forms?

https://perldoc.perl.org/perlform.html

by Brian Oxley (guest), 22 Feb 2019 01:46
sasi (guest) 21 Feb 2019 06:33
in discussion Hidden / Per page discussions » Tiles: Report on Programmatic Code Generation

I want to achieve functionality of creating report definition file (trdx) programmatically and then display into HTML5 page. …

https://www.besanttechnologies.com/training-courses/software-testing-training/selenium-training-institute-in-bangalore

by sasi (guest), 21 Feb 2019 06:33
Nathaniel J. Smith (guest) 16 Feb 2019 13:20
in discussion Hidden / Per page discussions » Graceful Shutdown

I posted a reply on the forum: https://trio.discourse.group/t/graceful-shutdown/93/5

by Nathaniel J. Smith (guest), 16 Feb 2019 13:20
Nathaniel J. Smith (guest) 09 Feb 2019 02:10
in discussion Hidden / Per page discussions » Two Approaches to Structured Concurrency

I'll set up a mailing list for a cross-language discussion of the topic and see whether it gets any traction.

Heh, funny you should say… I actually just set this up, and the reason I came back to your blog now was to figure out how to invite you to join :-). (I'm enjoying these discussions in the comments, but not getting notified when you reply is brutal for carrying on a conversation…)

Actually instead of a mailing list, I made a subforum on Trio's new Discourse forum: https://trio.discourse.group/c/structured-concurrency

So basically a mailing list, except with markdown support and support for lots of different forms of notification (including pure email workflows if that's what you're into). What do you think?

by Nathaniel J. Smith (guest), 09 Feb 2019 02:10

Thanks for the update!

In the mean time, Sam Mason did re-think this, and if you look at the production implementation of happy eyeballs in Trio now, it looks more like your libdill version than the version I presented in the talk.

Good to know.

In some ways this is a bit of a shame. One of the nice things about the original example is that it really exercised every single feature in Trio – cancel scope nesting, nurseries, the ability to pass nurseries around if you have to, etc. Not passing the nursery around definitely leads to nicer code, but not necessarily a nicer pedagogical example :-). Oh well!

I would personally that passing nurseries around is an anti-pattern, diluting the concept of coroutine ownership. Do we have any use cases where it is strictly necessary?

But, mainstream OSes don’t give regular programs any way to query this configuration, except to do a regular dual-protocol `getaddrinfo` and then follow the address ordering it gives back :-(

Yes, that's what I meant. I've used dns.c to get true concurrent DNS queries which in turn made it possible to implement full (kind-of) implementation of Happy Eyeballs. The intricacies involved in coordinating the async DNS queries with connection attempts were very instructive, at least to me. But Python is out of luck here, I guess.

Btw, after my talk about structured concurrency at FOSDEM I've was approached by few people and it turned out that different language communities are chewing on the concept. (Java, Golang, Nim.) I'll set up a mailing list for a cross-language discussion of the topic and see whether it gets any traction.

by martin_sustrikmartin_sustrik, 07 Feb 2019 05:37
Volkan Yazici (guest) 05 Feb 2019 10:43
in discussion Hidden / Per page discussions » Announcement: A talk about structured concurrency at FOSDEM

Thanks so much for the presentation Martin and it was also nice to meet with you. As I mentioned to you in the hallway, OpenJDK Project Loom is interested in your ideas. I have already raised up this lost meeting opportunity in the mailing list: http://mail.openjdk.java.net/pipermail/loom-dev/2019-February/000390.html If you are interested in, I believe you will be more than welcome to chime in. (Note that I am not a loom developer. So it is just my 2 cents.)

by Volkan Yazici (guest), 05 Feb 2019 10:43
Nathaniel J. Smith (guest) 05 Feb 2019 06:22
in discussion Hidden / Per page discussions » Two Approaches to Structured Concurrency

Heh, funny you should mention that! I only just happened to see this months later, but…

In early days of Trio, we actually had a restriction that the parent task/thread was *required* to get to the end of the nursery and block ASAP. In retrospect this was obviously the wrong approach, but well, it takes a while to figure these things out :-). We got rid of that ages ago now, but, I originally implemented happy eyeballs using that old version of Trio, and I never stopped to re-think whether having the parent task/thread available opened up any new ways to structure the algorithm…

In the mean time, Sam Mason did re-think this, and if you look at the production implementation of happy eyeballs in Trio now, it looks more like your libdill version than the version I presented in the talk.

In some ways this is a bit of a shame. One of the nice things about the original example is that it really exercised every single feature in Trio – cancel scope nesting, nurseries, the ability to pass nurseries around if you have to, etc. Not passing the nursery around definitely leads to nicer code, but not necessarily a nicer pedagogical example :-). Oh well!

Trio doesn't implement asynchronous DNS queries

You mean, you can't process the A and AAAA response packets separately as they arrive? You actually totally can – just do ‘await getaddrinfo("hostname.com", port, family=AF_INET)` to do the A query, and `await getaddrinfo("hostname.com", port, family=AF_INET6)` to do the AAAA query. We have an issue open to think about whether we can do anything clever with this, like Apple does in RFC 8305, but the answer is probably not, for a silly reason: mainstream OSes let sysadmins configure a preference for IPv4 vs IPv6, and the RFC 8305 algorithm relies on this preference. But, mainstream OSes don’t give regular programs any way to query this configuration, except to do a regular dual-protocol `getaddrinfo` and then follow the address ordering it gives back :-(. It might still be fun to implement the full RFC 8305 algorithm anyway, just to see how it looks.

by Nathaniel J. Smith (guest), 05 Feb 2019 06:22
Apostolis (guest) 04 Feb 2019 00:13
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

This is not abstraction. This is hiding of information. Both Dependent types and Temporal Logic of Actions
use abstraction and when they do, you do not need to look at what is inside those functions or the more refined specification.

Read from page 20 where Leslie talks about the difference between abstraction and hiding.
https://archive.computerhistory.org/resources/access/text/2017/07/102717246-05-01-acc.pdf

by Apostolis (guest), 04 Feb 2019 00:13
Michael Toomim (guest) 28 Jan 2019 03:03
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

I've also written academically on the coats of abstraction:
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/toomim-linked-editing.pdf

I love this example, and the accompanying narrative!

I just want to add that there *are* some valid reasons to split up the function ‘main` into `foo` and `bar`: if foo and bar represent *design concepts* in the programmer’s mental model, then it will actually make the program *simpler* to understand by breaking them into standalone functions. However, I agree that much of the time people break a function apart without naming the parts well, and it just becomes more obtuse.

by Michael Toomim (guest), 28 Jan 2019 03:03
michal@hanu.la (guest) 27 Jan 2019 12:52
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

Indirection is not abstraction (https://hanu.la/indirection.jpg)

While indirection might be an acceptable cost for abstraction, it is not the same thing.
(Abstraction is when you find a way that several seemingly different things are the same in a meaningful way and stop worrying about the differences. Indirection is when you put several different things in boxes, but still have to care about what is inside).

by michal@hanu.la (guest), 27 Jan 2019 12:52
The6P4C (guest) 27 Jan 2019 08:27
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

Unsurprisingly, unreadable code is still unreadable even if you throw abstraction into the mix.

by The6P4C (guest), 27 Jan 2019 08:27
rajaganesh87 (guest) 27 Jan 2019 08:22
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

Use proper function names which summarizes its role in the story.

by rajaganesh87 (guest), 27 Jan 2019 08:22
Foo Var (guest) 27 Jan 2019 07:48
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

A, B, …, E are horrible function names. You shold really learn how to use proper naming.

by Foo Var (guest), 27 Jan 2019 07:48
Konstantin (guest) 27 Jan 2019 07:31
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

I think your example has a flow it’s not clear what goes into each of A-E (and these are bad names for functions). If they are trivial code than sure keep in one function but otherwise some guy from testing camp will say that in order to make it testable you have to split it into 5 functions. So compromise would be to try to split the code but name in a such way that function names can be read as a poem and here we come to the hardest problem in programming — naming things.

by Konstantin (guest), 27 Jan 2019 07:31
The6P4C (guest) 27 Jan 2019 07:29
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

I think this is avoidable by factoring out /everything/ at once. Don't leave A and E before and after foo - they should be factored out into their own functions with self-explanatory names.

IMO your point seems right when you're just saying ABCDE and naming functions with placeholders, but when you factor out BCD the function shouldn't just be called "foo" - it's doBCD, where the name makes the purpose of the unit of work obvious.

The obvious example is some purchase calculation - imagine segments ABCDE of lookupProduct, applySitewideDiscount, applyCoupons, applyTax, processPurchase - you'd probably want to factor out all the cost calculation into some calculatePrice function, which calls applySitewideDiscount, applyCoupons, applyTax. I don't think that breaks the readability while skimming of your function, which would end up as lookupProduct, calculatePrice, processPurchase: much cleaner.

*Bad* abstraction breaks readability and flow, but good abstraction absolutely helps.

by The6P4C (guest), 27 Jan 2019 07:29
Why Not (guest) 27 Jan 2019 06:43
in discussion Hidden / Per page discussions » Confessions of an Abstraction Hater

[A, B, C, D, E].map(do)

by Why Not (guest), 27 Jan 2019 06:43

I think this is all possible with sufficiently advanced type system. One of the best and at the same time approachable treatment of the subject I've found here: https://wickstrom.tech/finite-state-machines/2017/11/10/finite-state-machines-part-1-modeling-with-haskell.html The second part gets to the gist of it https://wickstrom.tech/finite-state-machines/2017/11/19/finite-state-machines-part-2.html Specifically 'The State Machine Protocol' section.

by M R (guest), 13 Jan 2019 20:50
Nikos Koukis (guest) 03 Jan 2019 18:10
in discussion Hidden / Per page discussions » State Machines and the Strange Case of Mutating API

That's quite easy in a language like Rust.

There you could be using 1 class/state and all the methods (now standalone funs) to accept an instance of the expected class *by value* and return a new instance of the expected class? This way the caller would have to relinquish the ownership of the passed object, and wouldjn't be able to use it again after passing it to the fun (the latter is actually imposed by the language itself!

by Nikos Koukis (guest), 03 Jan 2019 18:10
Dan Massameno (guest) 02 Jan 2019 19:16
in discussion Hidden / Per page discussions » State Machines and the Strange Case of Mutating API

Have not had a chance to read all the comments, but has anyone seen Sing Sharp?
https://en.wikipedia.org/wiki/Spec_Sharp#Sing_Sharp
I've read the documents on the Singularity operating system. It looked awesome. Inter-process communication was type-safe, memory-safe, statically checked at compile time and used a finite state machine to control the flow of messages. Sing-Sharp was extended from Spec-Sharp, which was extended from C#.

I would really enjoy hearing from anyone that has read the Singularity research.

by Dan Massameno (guest), 02 Jan 2019 19:16
Yannick Moy (guest) 30 Dec 2018 17:50
in discussion Hidden / Per page discussions » State Machines and the Strange Case of Mutating API

Respect of an automaton in an API is a typical use case for contracts (preconditions and postconditions). See for example the first paragraph in this section of the SPARK formal programming language User's Guide: http://docs.adacore.com/spark2014-docs/html/ug/en/source/how_to_write_subprogram_contracts.html#writing-contracts-for-functional-correctness

Of course, that means you need a tool that can formally analyze your code, and a programming language that supports such a tool. It's possible in C with Frama-C but more difficult than with a language like SPARK meant for such formal analysis.

by Yannick Moy (guest), 30 Dec 2018 17:50
page 1123...next »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License