Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

rjmccall posted:

a good jit is a lot more involved than just asking llvm to compile some ir, because the point of a jit is to run code faster than an interpreter would, which means that if you're doing it right, you're putting a lot of work into deciding whether to jit and how much optimization you should do and how to take advantage of dynamic information and making the fallbacks work and ensuring that the different execution models interoperate, and it is all fun and really cool, but you probably do not actually want to do any of that on a raspberry pi, which means you probably ought to design a language that does not need a jit to achieve satisfactory performance, which seems to be exactly what common coder was doing anyway
Not every JIT needs to be a tracing JIT. Maybe you just want to provide a REPL, or do some highly target-specific optimizations prior to startup, or are implementing a system on AOT principles but will only get code at runtime. Or any number of other things. Tracing JITs are an interesting engineering problem but they're by no means the only useful kind, particularly for languages with decent type systems and limited amounts of dynamic dispatch.

Adbot
ADBOT LOVES YOU

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
If you write C/Java/whatever and aren't putting spaces between function arguments you are a bad person

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

MononcQc posted:

Erlang also just goes "failed to allocate, gently caress this I'm out" if you don't allow it to use Swap or anything. For server-software (taking back the dig at Go), it's often a reasonable way to do things because most people build their poo poo to handle going offline on specific instances from time to time. That's how most people deploy anyway.
Specifically, this is a reasonable way to handle OOM (and other borderline-unrecoverable errors) because if you are writing large-scale server software and your system can't handle processes/machines/datacenters randomly going offline, you're doomed to slow and painful failure.

Also, you know, the whole "linux makes it futile anyway" thing.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

VikingofRock posted:

I guess I can see that, but personally I don't really think it's that big a cognitive overhead and I'd rather have the compile time guarantee that the value is not null :shrug:. But it's good to know that passing by pointer is idiomatic in case I ever write C++ on a team.
Non-const references are certainly just a style concern and will vary from team to team. That said, it it's important to understand that references of any kind are you promising to the compiler that you'll never bind them to an invalid address. It's very easy to write a program that will do so without doing anything particularly strange and the compiler won't stop you.

On the other hand, using references provides enough information to other tools (for example, clang's undefined behavior sanitizer) to automatically insert runtime sanity checks everywhere appropriate to catch this kind of error and abort with an informative error message and backtrace.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

FamDav posted:

is there a compiler setting in gcc or clang that will warn if you try to assign a subclass to a reference?
Assuming you mean "initialize a reference with an object whose type is a subclass of the referenced type," no, for the same reason there's no warning if you try to upcast a pointer. It's a safe and normal thing to do.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

FamDav posted:

no, i mean assignment

why would i mean initialization
because if you meant assignment then that's a perfectly normal operator= invocation on the referenced object and whatever value you're assigning, and whether the lhs is a reference or an object isn't really relevant?

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Sometimes in Haskell the type is clearer if you don't write it. This happens mainly when there's ridiculously generic things going on which have some fairly mundane cases. You see a lot of it in the lens library.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
It's amazing how much mainstream modern development has regressed in terms of debugging tools. Forth, Common Lisp, etc. all had all kinds of wonderful infrastructure like that and beyond.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Blotto Skorzany posted:

what sort of wonderful tooling did forth have
It was lower level than C but still had about half of what made Lisp fun. Interactive debugging, unreasonably powerful metaprogramming, dynamic access to the compiler, etcetera. I've heard of some pretty crazy lisp-machine-esque IDEs too. It's kind of amazing how much we as an industry failed to capitalize on all that tech.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Gazpacho posted:

the industry didn't "fail" re: forth, it's just a terrible language for expressing computational ideas to other people

postscript, which shares some relevant characteristics, succeeded because humans rarely use it directly
Not with regard to Forth itself, but with that class of interactive development tooling at large. One day new languages just stopped having them.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Phobeste posted:

sometimes i read these posts about row polymorphism and go "what the gently caress is this look at these smart fellers"

then i remember it's just writing a c++ thing that takes a class type as a template argument and relies on that class type to have a given function or it breaks horribly and i think remember that 99.99999999999% of thetime a well-named interface is better
Row polymorphism gives you the error up front instead of exploding into a million shards of angry templates. Still not a great way to structure a system, though.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Tiny Bug Child posted:

who gives a poo poo what the url looks like. "restful urls" or whatever are stupid cause you can only put one meaningful bit of information in them and you gotta use a query string for everything else anyway
There is a continuum. At one end, the entire website is implemented query strings. At the other, it's all fancy URLs. Neither endpoint is remotely sane. The sweet spot is a bit further away from query strings than SA.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
If you aren't forced to work with legacy tools, you can use std::experimental::optional

I think there's a standard variant type on the way too.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Barnyard Protein posted:

yeah Tcl is another language without a grammar, it has syntactic rules, but a bnf grammar doesn't exist
"without a bnf grammar" and "without any grammar at all" are very different statements.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
So he took a version of Lisp from before most of the really cool features had been developed, removed the cool features that were left, then added back in screwy half-usable square wheel reinventions of everything?

:psyduck:

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

tef posted:

lisp doesn't have any cool features but it comes with a cool features toolkit, where you can write your own ad-hoc, underspecified, never documented, control flow structures
I'll take CLOS over what you just laid out any day

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Cybernetic Vermin posted:

the main nicety of cl is that the library is both sane and comprehensive

scheme is really neat, but it is fantastically unfortunate in timing, because the usual false ideal of purity ended up running the far more sensible cl out of town, and both died unloved
I don't know any schemes that actually enforce purity, they just encourage it, which I think even the mainstream is beginning to acknowledge is a good idea.

Racket's pretty neat and about as batteries-included as it gets. There's even Typed Racket, which is surprisingly successful at letting you statically type-check idiomatic Lisp code.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

VikingofRock posted:

Is idris cool? I've been having the itch to learn a semi-useless language recently, and right now I'm thinking one of idris (for loving around with functional stuff), some lisp dialect (for the same reasons), ruby (for loving around with metasploit), or elm (for loving around with web stuff).
If you want to play with dependent types, learn Coq or Agda instead. Or just wait for the GHC extension that'll add them.

Lisp is pretty cool. Racket's probably the easiest to get started with/least warty.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Racket might be getting dependent types too soon, so that's pretty neat.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

pepito sanchez posted:

as for haskell i read a bit about it recently, and the answers for it are always so obscure. i don't see real world application in it at the moment, yet everyone says it'll make you think as a better programmer by practicing it. it's something i can see happening considering its capabilities. but then again - in the same way - i can see myself being a better programmer focusing more of my time just learning more about C, something still widely used and applicable. i don't yet see how the restrictions of a programming language i don't know could make me better at something i already somewhat know. it's not like re-learning a keyboard's layout and programming your brain to get used to dvorak instead of qwerty the homekey way. OO langs have design patterns that transcend the specific language you're working in, functional programming has "don't-gently caress-up"s, and the fact that most of them dynamically typed make them extremely unappealing.
You don't really grow as a programmer in important ways by memorizing the finer details of the C spec. You grow as a programmer by finding completely new ways of looking at problems.

fritz posted:

ive fought with enough c macroes to know that however good lisp might be, it's not worth it
These two things are not alike. Lisp macros are regular lisp functions that take and return syntax trees instead of values.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

MALE SHOEGAZE posted:

truth, but doesn't even touch on the actually lovely part of trying to test dynamic poo poo: getting your state set up properly to test.
If your code is a mess of global state it's not the language's fault.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
There's some pretty cool data-parallel parsing techniques that put SIMD hardware to work.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Speaking of static typing, web development, and performance, Ur/Web is really cool and should be used more.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Language designers aren't infallible uber-programmers. They make the same mistakes, it's just harder for them to go back and fix them afterwards.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Soricidus posted:

i'd be more inclined to agree with this if python3 had fixed a few more of these bad decisions

making mistakes is one thing, doubling down and insisting that the mistake is good is something else entirely
Rationalizing misguided design decisions is at least as large a source of resistance against change as backwards compatibility concerns.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Blotto Skorzany posted:

do the segments have to be split at keyframes for this to work?
You can't just chop a video stream in half byte-wise regardless. Whether you're using raw video as input, or you're introducing new keyframes as necessary, or selecting the nearest keyframe, one way or another the split segments end up starting on a keyframe.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

hackbunny posted:

C++ has a standard equality method: you overload the == operator for your class. what it doesn't have is a standard hash method
You may have been aware of this already, but in C++11 it's actually kosher to specialize the std::hash struct template to achieve this.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

pepito sanchez posted:

i'd like to learn more c/c++ but i never could think of a decent little weekend project i could come up with that wouldn't bore me out of my mind, and help me get a better understanding.

also just found out about boost libraries. not like it's a new thing. so with my very limited c++ knowledge is this a good thing for hackbunny's hash grievance?
Boost is a lot less relevant if you're using modern C++ (i.e. C++11, 14, or 17). It's also huge and ugly (due in large parts to supporting non-modern C++) and drags your compile times into the ground.

A raytracer is a good classic weekend project sort of thing. Gives you a good excuse to play around with performance optimization.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

jre posted:

Hmm, So I could use the slack app on my phone to let the team know my train didn't show up, or I could try and access some awful gaffa taped together pile of irc garbage ?
Or you could do the thing he's talking about instead.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

MrMoo posted:

It is still janky on my Macbook Air, I can see canvas + RAF the alternatives are quite challenging though: WebGL or SVG. SVG would not GPU accelerate though, still waiting for Google to unbreak web animations.
GPU acceleration should not be even remotely relevant to simple 2D animations like this.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Barnyard Protein posted:

where does racket fall on the spectrum? i know where it places me on the spectrum, but there's basically no scripting language i can use at work besides windows .bat files that won't have someone calling me an rear end in a top hat
Racket is really nice. Tons of libraries, JIT, Lisp's trademark ridiculous flexibility tempered by a lot of hard-learned lessons on encapsulation, etc. Contains a lot of dialects implemented in itself, including Typed Racket which is pretty cool if you like finding your bugs ahead of time.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Suspicious Dish posted:

Have some probably wrong observations about 3D Graphics APIs and Vulkan: http://blog.mecheye.net/2015/12/why-im-excited-for-vulkan/
This was pretty interesting! I had wondered what the incentives around the development of Mantle were. Any chance you can cite sources for your claim that nvidia was responsible for the OpenGL 3 failure?

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Brain Candy posted:

but every nanosecond spent translating my Butt type to your Butt type is a nanosecond wasted.
But you have to do this with dynamic typing too, you're just vastly more likely to forget it somewhere and have your code explode in production :confused:

Types exist regardless, the only question is how much the compiler knows about them in advance.

It sounds like you're just complaining about bad API design regardless of paradigm.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Definitely better to have the features people can agree on now rather than let them be blocked for years by the ones people can't.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

AWWNAW posted:

because it's easier I guess

Doing an initial pass to collect top level declarations is really not hard. If for some crazy reason you allow top level declarations without type annotations it requires some care in your type checker, but that's karma.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Athas posted:

Haskell slow.

Still use it.

The performance ceiling is actually remarkably high. As with any language, it does take a bit of specialist knowledge to get the most out of your resources, of course.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Bloody posted:

wait im confused

in foo1/foo2/foo3 from https://en.wikipedia.org/wiki/Tail_call#Syntactic_form
foo2 looks like the only one that is in tail position but the description text that follows disagrees?

https://en.wikipedia.org/wiki/Tail_call#Syntactic_form posted:

Here, the call to a(data) is in tail position in foo2, but it is not in tail position either in foo1 or in foo3
:confused:

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Brain Candy posted:

i think partly that you can just go ahead and do things that are much harder to express fully in a static type system

see haskell's lens versus just using assoc and cons
But lens isn't for heterogeneous maps? Those are straight up hard but you pretty much always want a sum type of some variety instead anyway. Lens also does lots of super neat generic stuff that would be difficult to make usable without static typechecking.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Heterogeneous anything usually only makes sense if you pretend algebraic datatypes don't exist.

MononcQc posted:

It's nice because you can use similar stuff for TCP sockets like [raw, keep_alive, whatever] and merge that list with SSL options like [{private_key, "some data"}, {cipher_suites, ["AES-...", "ECDHA-..."]}, {sni_hostname, "example.org"}, ...] and have it work together. I guess you would enumerate all the possible combinations in your type signature if you really wanted to, you're just not forced to do it in a dynamic lang.
I'm not sure why you wouldn't always prefer this stuff to be statically checked. Vulkan pervasively uses options structs like this in C of all places and it works great. If a better version of your API can be expressed in C you're not accomplishing very much.

Adbot
ADBOT LOVES YOU

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

MononcQc posted:

The types are just not necessary to make it work, and not all type systems are necessarily nifty enough to allow that without problem, or to encode all constraints properly (i.e. you probably can't have a file that is both using 'raw' encoding and a 'utf8' encoding at once, but encoding that in the type system is often not doable and still requires external logic anyway)
If your type system is that much less expressive than C's I don't think it gets to be called a type system anymore.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply