|
Beef posted:Or writing a source file, syscalling gcc and dlopening the result. Is this seriously a real thing?
|
# ? Jul 15, 2017 15:37 |
|
|
# ? Jun 5, 2024 06:04 |
|
Xik posted:Is this seriously a real thing? MemSQL does this, works surprisingly well.
|
# ? Jul 15, 2017 17:19 |
|
It is used for optimization at runtime, such as libxsmm (used by tensor flow) compiling matrix-size-specific routines. It is the standard way of providing hotswapping/dynamic compilation in C/C++. I assume Unreal 4 does it as well.
|
# ? Jul 15, 2017 19:14 |
|
comedyblissoption posted:Some languages handle errors as values and also will warn you if you accidentally don't use a return value and handle the error. That's one prime reason I've written all my new code in F# instead of C#, and made all my projects run with full warnings and warnings as errors - the Result pattern and the pain that was unhandled and essentially hidden code paths.
|
# ? Jul 15, 2017 21:06 |
TheBlackVegetable posted:That's one prime reason I've written all my new code in F# instead of C#, and made all my projects run with full warnings and warnings as errors - the Result pattern and the pain that was unhandled and essentially hidden code paths. I've never looked into F# before. It looks... good? Someone tell me the nightmare truth behind it before I get suckered into learning another language.
|
|
# ? Jul 15, 2017 21:25 |
|
Eela6 posted:I've never looked into F# before. It looks... good? Someone tell me the nightmare truth behind it before I get suckered into learning another language. F#'s biggest issue for me is the seeming lack of support from Microsoft. It's not as bad as it once was, but if you're looking for things like, say, templates or documentation from MS, it's not as good as C#. Also, if you wanna make a UWP app, you can't use F# until .NET Standard 2.0, since it doesn't support .NET Native until then. Beyond that, it is really cool. I've been writing our internal tooling in F# for about a year now and it's great.
|
# ? Jul 15, 2017 21:49 |
|
Poor vendor support, and all the libraries are actually C# libraries.
|
# ? Jul 15, 2017 21:50 |
|
I recently switched my embedded projects over to libressl, and got libressl accepted into buildroot mainline. That's not the coding horror. I learned today that OpenSSL has support for VMS and Big Endian AMD64.
|
# ? Jul 15, 2017 23:52 |
|
Eela6 posted:I've never looked into F# before. It looks... good? Someone tell me the nightmare truth behind it before I get suckered into learning another language.
|
# ? Jul 16, 2017 03:45 |
|
comedyblissoption posted:Unless they fixed it, F# uses a single pass compiler that requires you to declare everything before use in a sequential manner and structure your source files accordingly w/o the benefit of header-like files. Some will claim this is a boon, but that is stockholm syndrome. It is a boon, because if you think you need mutual references in your types, you probably have a bad architecture (use interfaces) - languages that let you mix and match are much more easily turned into spaghetti. They did recently add the ability to mark a module "rec" so that all types declared in the file can refer to all others, if you really need to lean on that crutch.
|
# ? Jul 16, 2017 05:35 |
comedyblissoption posted:Unless they fixed it, F# uses a single pass compiler that requires you to declare everything before use in a sequential manner and structure your source files accordingly w/o the benefit of header-like files. Some will claim this is a boon, but that is stockholm syndrome. You have to do that in every interpreted lanaguage, so it's NBD to me. Not a boon, but I'm used to it already. I do prefer it the other way, though.
|
|
# ? Jul 16, 2017 05:40 |
|
code:
|
# ? Jul 16, 2017 06:24 |
|
FrantzX posted:
Looks normal. What am I missing?
|
# ? Jul 16, 2017 06:41 |
|
Shinku ABOOKEN posted:Looks normal. What am I missing? When key is 0, the if ==0 and the else block both execute Also, magic numbers
|
# ? Jul 16, 2017 06:44 |
QuarkJets posted:When key is 0, the if ==0 and the else block both execute I FIXED IT code:
|
|
# ? Jul 16, 2017 06:47 |
|
QuarkJets posted:When key is 0, the if ==0 and the else block both execute Reminds me of a bug I found in our code a few months ago: C++ code:
|
# ? Jul 16, 2017 06:50 |
|
Eela6 posted:I FIXED IT Hahaha. I saw that kind of thing in code (#define BILLION 1000000000 or something like that). And the developer even defended it .
|
# ? Jul 16, 2017 06:51 |
|
Obviously the correct way is to employ a user-defined literal C++ code:
|
# ? Jul 16, 2017 06:55 |
|
Volguus posted:Hahaha. I saw that kind of thing in code (#define BILLION 1000000000 or something like that). And the developer even defended it . I guess we'll see who's laughing when you have to compile the british version of this program.
|
# ? Jul 16, 2017 06:57 |
|
QuarkJets posted:When key is 0, the if ==0 and the else block both execute Ugh that's the worst. I genuinely couldn't see it.
|
# ? Jul 16, 2017 07:04 |
|
Dr. Stab posted:I guess we'll see who's laughing when you have to compile the british version of this program. I'm sorry to say that this is the same in the UK. The other billion definition went away long ago.
|
# ? Jul 16, 2017 09:16 |
|
Eela6 posted:I've never looked into F# before. It looks... good? Someone tell me the nightmare truth behind it before I get suckered into learning another language. F# probably has better tooling than any other functional language. It has flaws compared to the big functional languages (Haskell, OCaml, SML, Scala), but unless you're experienced in them, you won't notice. Some of its uglier parts are rooted in compromises to enable good .NET compatibility, but that is probably also its main selling point, so somewhat unavoidable. It is good language and nobody will leave you out of their party invitations for using it.
|
# ? Jul 16, 2017 09:30 |
|
Jaded Burnout posted:I'm sorry to say that this is the same in the UK. The other billion definition went away long ago. The long scale has survived in the rest of Europe and half the Americas so there's still tons of people to confuse by using billion as a constant name.
|
# ? Jul 16, 2017 10:08 |
|
Absurd Alhazred posted:Reminds me of a bug I found in our code a few months ago: This should be a syntax error.
|
# ? Jul 16, 2017 11:20 |
|
I'm gonna defend the BILLION define because I don't want to count the zeroes every time someone uses a huge number, and people don't use 1e9 etc for integers.
|
# ? Jul 16, 2017 14:13 |
|
Is that not at least a warning on all good compilers?
|
# ? Jul 16, 2017 14:14 |
|
TheBlackVegetable posted:It is a boon, because if you think you need mutual references in your types, you probably have a bad architecture (use interfaces) - languages that let you mix and match are much more easily turned into spaghetti. Some things are mutually recursive by nature (think syntax trees) and there's nothing wrong with it. https://github.com/Microsoft/visualfsharp/blob/master/src/fsharp/TypeChecker.fs#L4142 scroll down to line 11803 where this let rec...and... block ends and tell me that single pass is good. In many languages, people put their public methods at the top of the file so that people coming in can look at the class's behavior from the top-down. F# helpfully requires users to specify the behavior of everything in the universe from the bottom-up, making the best way to look for the interesting part of a program to go to the bottom of the last source file and work your way up. Interfaces doesn't solve the issue of types that are mutually recursive and single-pass makes traversal of mutually recursive structures like syntax trees or other PL-related data structures hard to maintain, if you couldn't tell from that code sample. Single-pass is on the short list of mistakes F# makes that make it totally unviable for mainstream development. brap fucked around with this message at 15:09 on Jul 16, 2017 |
# ? Jul 16, 2017 15:03 |
|
fleshweasel posted:Some things are mutually recursive by nature (think syntax trees) and there's nothing wrong with it. I disagree bottom-up being a problem, though I'm phone posting so I didn't look at that code yet. Fair enough if you're writing lots of syntax trees and the like (are you? Is that mainstream development? Does your data structure not fit in one file?), but F# is entirely viable and suitable for mainstream development because most code isn't like that and I believe it benefits from strict hierarchical requirements. TheBlackVegetable fucked around with this message at 15:33 on Jul 16, 2017 |
# ? Jul 16, 2017 15:28 |
|
fleshweasel posted:Some things are mutually recursive by nature (think syntax trees) and there's nothing wrong with it. Single-pass doesn't prevent you from coding those things, it makes you place them next to each other. Which is probably where they should be. Yes, the example you quote is super long (because the F# type-checker is actually a complicated piece of work), but would that code be improved by scattering those mutually-recursive types across fifteen different files, instead of sticking them together? I doubt it. Along similar lines, when I use inheritance - in any language - I generally place the subclasses in the same file as the base class. Often I make them nested classes, if I think the info is worth the extra verbosity (e.g. Vehicle.Car.Toyota.Corolla). I believe any tight coupling in the code should be reflected in the code layout. quote:In many languages, people put their public methods at the top of the file so that people coming in can look at the class's behavior from the top-down. F# helpfully requires users to specify the behavior of everything in the universe from the bottom-up, making the best way to look for the interesting part of a program to go to the bottom of the last source file and work your way up. This is why projects generally introduce .fsi files (which the compiler can generate automatically) once they become too big to navigate by quickly skimming. No need to screw up the code's logical structure just for the sake of having a quick reference. I do actually think that it might be nice if the F# compiler proceeded upwards instead of downwards, privileging the code reader over the code writer. The problem is that it would be super confusing to have local declarations go one way and global declarations the other way. And having local declarations go from last to first, like in Haskell's 'where', would work very poorly in an eager-by-default language. NihilCredo fucked around with this message at 15:50 on Jul 16, 2017 |
# ? Jul 16, 2017 15:46 |
|
I found this page that aggregated commits to LibreSSL until they switched to GitHub. http://opensslrampage.org/page/49 Some of the things they found is just... The INTERNET runs off of this piece of poo poo.
|
# ? Jul 16, 2017 15:51 |
|
ratbert90 posted:I found this page that aggregated commits to LibreSSL until they switched to GitHub. After having to use OpenSSL just for some relatively simple crypto stuff I can say that its API is hot garbage and makes you
|
# ? Jul 16, 2017 16:14 |
|
omeg posted:After having to use OpenSSL just for some relatively simple crypto stuff I can say that its API is hot garbage and makes you
|
# ? Jul 16, 2017 16:22 |
|
Ghost of Reagan Past posted:The API is basically the worst thing I've ever seen. It's so bad that it has to have been intentionally designed to cause madness. Well when you rewrite malloc that doesn't free because your mallocs now live in a LIFO, your API is probably the least of your worries. Also supporting BIG ENDIAN AMD64 AND VMS.
|
# ? Jul 16, 2017 16:25 |
|
Absurd Alhazred posted:Reminds me of a bug I found in our code a few months ago: Yeah a colleague had done that years ago as well in Java. Caused a really nasty bit of corruption. Actual content: it is not so much a coding gorror as development process horror, but apparently I am doing things incorrectly by not checking the assembly before I delivered the code to ensure that the compiler is doing its job.
|
# ? Jul 16, 2017 17:09 |
|
Vanadium posted:I'm gonna defend the BILLION define because I don't want to count the zeroes every time someone uses a huge number, and people don't use 1e9 etc for integers. I'm sorry, it is not defensible in any situation (#define, const long, whatever). And that applies to numbers like 55, 100, or a googol. That constant/macro you define for a purpose: sleep time in an infinite loop, maybe magic number, maybe ... whatever it may be. Then entire reason to have it a constant is so that you can change it easily should you need to, and only change it in one spot and to give it a name that shows its purpose. You can never change BILLION to have value 23, it wouldn't make any sense. This kind of code code:
|
# ? Jul 16, 2017 17:49 |
|
idiotmeat posted:Actual content: it is not so much a coding gorror as development process horror, but apparently I am doing things incorrectly by not checking the assembly before I delivered the code to ensure that the compiler is doing its job. I mean, that’s not totally unreasonable? What test content had you run that passed? In the event there’s no existing content or HW to check high level code against, asm inspection is fine.
|
# ? Jul 16, 2017 18:01 |
|
idiotmeat posted:Yeah a colleague had done that years ago as well in Java. Caused a really nasty bit of corruption. I thought any decent compiler would emit a warning if you put a semicolon after an if like that. Actually, though, would anything be lost if they made it so that a semicolon by itself isn't a valid C statement?
|
# ? Jul 16, 2017 18:02 |
|
Volguus posted:I'm sorry, it is not defensible in any situation (#define, const long, whatever). And that applies to numbers like 55, 100, or a googol. That constant/macro you define for a purpose: sleep time in an infinite loop, maybe magic number, maybe ... whatever it may be. Then entire reason to have it a constant is so that you can change it easily should you need to, and only change it in one spot and to give it a name that shows its purpose. You can never change BILLION to have value 23, it wouldn't make any sense. Do you feel the same way about pi or e?
|
# ? Jul 16, 2017 18:10 |
|
Absurd Alhazred posted:Do you feel the same way about pi or e? You mean the constants that are almost always provided by a math library? The reason you make constants out of those kinds of things is to prevent typos.
|
# ? Jul 16, 2017 18:16 |
|
|
# ? Jun 5, 2024 06:04 |
|
Absurd Alhazred posted:Do you feel the same way about pi or e? I'd be pretty upset if you had made a constant called THREE_POINT_ONE_FOUR_ONE_FIVE_NINE.
|
# ? Jul 16, 2017 18:17 |