ShaunR Posted November 17, 2023 Report Share Posted November 17, 2023 16 hours ago, Neil Pate said: Not for me though, my low level messaging uses events and that is just waaaaay to much drama to have separate events for every message. I wrap it up a layer with typedefs though, just the data is transported in a variant. If only there were a way that one could use strings to define the event. We could call them, let me see, "Named Events"?. Quote Link to comment
Neil Pate Posted November 17, 2023 Report Share Posted November 17, 2023 1 hour ago, ShaunR said: If only there were a way that one could use strings to define the event. We could call them, let me see, "Named Events"?. I am not against your idea of adding a bit of love to the events implementation. Quote Link to comment
ShaunR Posted November 17, 2023 Report Share Posted November 17, 2023 14 minutes ago, Neil Pate said: I am not against your idea of adding a bit of love to the events implementation. Actually. your particular problem is that the variant type is only a half-arsed variant type. It's easy to get something into a variant, but convoluted and unwieldy to get them out again. I think "Generics" were supposed to resolve this but they never materialised. I shake my head with the recent push in the software industries to strict type everywhere. Most of the programming I do is to get around strict typing. Quote Link to comment
Neil Pate Posted November 17, 2023 Report Share Posted November 17, 2023 18 minutes ago, ShaunR said: I shake my head with the recent push in the software industries to strict type everywhere. Most of the programming I do is to get around strict typing. While I appreciate dynamic languages and the flexibility they offer I think this is pretty bold blanket statement and is totally context sensative. Would you want to write a driver for your GPU with a language that does not offer strict typing? Quote Link to comment
ShaunR Posted November 17, 2023 Report Share Posted November 17, 2023 3 hours ago, Neil Pate said: Would you want to write a driver for your GPU with a language that does not offer strict typing? Oddly specific. I would want a method of being able to coerce to a type for a specific line of code where I thought it necessary (for things like precision) but generally...bring it on. After all. In C/C++ most of the time we are casting to other types just to get the compiler to shut up. They broke PHP with class scoping. They are now proposing breaking it more with strict typing. Typescript is another. It's the latest fad. Quote Link to comment
Rolf Kalbermatter Posted November 17, 2023 Report Share Posted November 17, 2023 1 minute ago, ShaunR said: Oddly specific. I would want a method of being able to coerce to a type for a specific line of code where I thought it necessary (for things like precision) but generally...bring it on. After all. In C/C++ most of the time we are casting to other types just to get the compiler to shut up. Easy typecasting in C is the main reason for a lot of memory corruption problems, after buffer overflow errors, which can be also caused by typecasting. Yes I like the ability to typecast but it is the evil in the room that languages like Rust try to avoid in order to create more secure code. Typecasting and secure code are virtually exclusive things. 1 Quote Link to comment
hooovahh Posted November 17, 2023 Report Share Posted November 17, 2023 21 hours ago, Neil Pate said: Not for me though, my low level messaging uses events and that is just waaaaay to much drama to have separate events for every message. I wrap it up a layer with typedefs though, just the data is transported in a variant. For me each message is it's own user event that is a variant, that gets created at the start. Then you can use it as a publisher/subscriber paradigm because you can create an array of these user events and register for them all at once. This is great for debug since a probe can just subscribe for all user events and see all traffic between actors. The Variant has an attribute that is Event Name, that is pulled out so the one event case handles them all, but the name is unique. VI Scripting creates a case to handle each unique user event, with a type def on how to get the requested data out, and if it is synchronous, another type def to put the data back as a reply. New cases are created with VI scripting to generate the VIs for request, convert, response, and the case structure. Quote Link to comment
Neil Pate Posted November 17, 2023 Report Share Posted November 17, 2023 5 minutes ago, hooovahh said: For me each message is it's own user event that is a variant, that gets created at the start. Then you can use it as a publisher/subscriber paradigm because you can create an array of these user events and register for them all at once. This is great for debug since a probe can just subscribe for all user events and see all traffic between actors. The Variant has an attribute that is Event Name, that is pulled out so the one event case handles them all, but the name is unique. VI Scripting creates a case to handle each unique user event, with a type def on how to get the requested data out, and if it is synchronous, another type def to put the data back as a reply. New cases are created with VI scripting to generate the VIs for request, convert, response, and the case structure. Sure I know this pattern well, just prefer to have a single "mailbox" type event inside my actors for messages into the actor. I don't want to deal with the drama and scripting just to be able to have different typed events. My layer above the variant is all typed, so I don't really have an issue with converting variants to their real types. But of course everyone must do whatever pleases them most. I have way that works for me, my team, and the kinds of things that we build, so have no need to make it more complicated. Quote Link to comment
ShaunR Posted November 17, 2023 Report Share Posted November 17, 2023 (edited) 39 minutes ago, Rolf Kalbermatter said: Easy typecasting in C is the main reason for a lot of memory corruption problems, after buffer overflow errors, which can be also caused by typecasting. Yes I like the ability to typecast but it is the evil in the room that languages like Rust try to avoid in order to create more secure code. Typecasting and secure code are virtually exclusive things. Don't have that problem with dynamic typing. Typecasting is the "get out of jail" card for typed systems. This one seem familiar? linger Lngr={0,0}; setsockopt(Socket, SOL_SOCKET, SO_LINGER, (char *)&Lngr, sizeof(Lngr)); DWORD ReUseSocket=0; setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char*)&ReUseSocket, sizeof(ReUseSocket)); Edited November 17, 2023 by ShaunR Quote Link to comment
hooovahh Posted November 17, 2023 Report Share Posted November 17, 2023 37 minutes ago, Neil Pate said: Sure I know this pattern well, just prefer to have a single "mailbox" type event inside my actors for messages into the actor. Oh yeah I'm not trying to convince anyone, I just was putting it out there in case others aren't aware of this style of messaging. I prefer the design I described it because it makes life easier on the developer using the API, at the expense of extra work on the architect making it. Quote Link to comment
Rolf Kalbermatter Posted November 17, 2023 Report Share Posted November 17, 2023 20 minutes ago, ShaunR said: Don't have that problem with dynamic typing. Typecasting is the "get out of jail" card for typed systems. This one seem familiar? linger Lngr={0,0}; setsockopt(Socket, SOL_SOCKET, SO_LINGER, (char *)&Lngr, sizeof(Lngr)); DWORD ReUseSocket=0; setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char*)&ReUseSocket, sizeof(ReUseSocket)); Of course it looks familiar. When not programming LabVIEW (or the occasional Python app) I program mainly in C. It's easy to typecast and easy to go very much ashtray. C tries to be strictly typed and then offers typecasting where you can typecast a lizard into an elephant and back without any compiler complaints 😀. Runtime behavior however is an entirely different topic 🤠 Quote Link to comment
ShaunR Posted November 17, 2023 Report Share Posted November 17, 2023 1 hour ago, Rolf Kalbermatter said: Of course it looks familiar. it was meant tongue in cheek and specifically chosen because you've done it a million times (probably). I wonder what the forum mark-up is for that? Quote Link to comment
Popular Post Neil Pate Posted November 17, 2023 Popular Post Report Share Posted November 17, 2023 2 hours ago, Rolf Kalbermatter said: It's easy to typecast and easy to go very much ashtray. @Rolf Kalbermatter I know you did not mean this, but I love it! 4 Quote Link to comment
ShaunR Posted November 18, 2023 Report Share Posted November 18, 2023 14 hours ago, Neil Pate said: @Rolf Kalbermatter I know you did not mean this, but I love it! I love Rolf's eggcorns. I never point them out because he knows my language better than I do. 1 Quote Link to comment
Rolf Kalbermatter Posted November 18, 2023 Report Share Posted November 18, 2023 (edited) 1 hour ago, ShaunR said: I love Rolf's eggcorns. I never point them out because he knows my language better than I do. Interesting word 😀. Learned a new thing and that this was only invented in 2003. As to knowing English better than you do, you definitely give me more praise than I deserve. Edited November 18, 2023 by Rolf Kalbermatter Quote Link to comment
Bryan Posted November 18, 2023 Report Share Posted November 18, 2023 I'm just now hearing of the word 'eggcorn' as well. The definition sounds like something that I have often done intentionally while talking with friends for comedic effect. Quote Link to comment
ShaunR Posted November 18, 2023 Report Share Posted November 18, 2023 (edited) 14 minutes ago, Bryan said: I'm just now hearing of the word 'eggcorn' as well. The definition sounds like something that I have often done intentionally while talking with friends for comedic effect. A malapropism is similar but more common for comedy because it doesn't need to make sense in context (so it's easier and funnier). Edited November 18, 2023 by ShaunR Quote Link to comment
Bryan Posted November 18, 2023 Report Share Posted November 18, 2023 (edited) 25 minutes ago, ShaunR said: A malapropism is similar but more common for comedy because it doesn't need to make sense in context (so it's easier and funnier). Well, now I've learned two new words. Thanks! Edited November 18, 2023 by Bryan Quote Link to comment
Neil Pate Posted November 18, 2023 Report Share Posted November 18, 2023 5 hours ago, ShaunR said: I love Rolf's eggcorns. I never point them out because he knows my language better than I do. I am pretty sure Rolf knows it is not any kind of criticism. Quote Link to comment
ShaunR Posted November 18, 2023 Report Share Posted November 18, 2023 32 minutes ago, Neil Pate said: I am pretty sure Rolf knows it is not any kind of criticism. Not that so much but he might be right and I've been using an eggcorn for my entire life. 1 Quote Link to comment
hooovahh Posted November 20, 2023 Report Share Posted November 20, 2023 I knew of the malaphor only because my wife does it all the time, but then insists her phrase is the way people always say it. When you are up a creek, you are without a paddle. A bird in the hand catches bees with honey. Does the pope crap in the woods? 1 Quote Link to comment
ShaunR Posted November 21, 2023 Report Share Posted November 21, 2023 (edited) 17 hours ago, hooovahh said: I knew of the malaphor only because my wife does it all the time, but then insists her phrase is the way people always say it. I had a girlfriend like that. It turned out that her father used mix metaphors for comic effect but she didn't realise and thought it was the correct metaphor. When she said "everyone says it like that" what she meant was "my family says it like that" Edited November 21, 2023 by ShaunR 2 Quote Link to comment
Jack Parmer Posted December 9, 2023 Report Share Posted December 9, 2023 If you want the best of both worlds, you can try Flojoy, which is primarily no-code, but also allows extensibility in Python for those who want to dabble in code. If you try Flojoy (it's free, no-code, and open-source), please leave your thoughts, reviews, feedback, and suggestions in this post: 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.