814 karma · joined January 8, 2017
That's why Stream::map can not capture the checked exceptions properly.
But I don't think C#, Kotlin or Scala are less safe than Java even if they do not have the concept of checked exceptions.
[1] https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
logger.log("start")
defer logger.log("exit")
...
for keeping alive a reference (because you need to call C code) global.keepalive = myvar
defer global.keepalive = undefined
...
// call C code here
etc let connection = getConnection()
defer connection.dispose()
...
being equivalent to let connection = getConnection()
try {
...
} finally {
connection.dispose()
}
"defer" unlike "using" does not require a specified entry point method, so no [Symbol.dispose] required.There is an example in the tutorial about how state are handled [1]. [1] https://vanjs.org/tutorial#state-binding
I suppose it's to avoid sneaky libraries that dynamically starts an agent to crack open the code of the JDK.
I believe the issue is between the profiler thread and the shutdown hook thread. Both will run concurrently because the profiler thread is marked deamon. So the shutdown hook thread can see the Profiler fields not fully initialized. The call to addShutdownHook() should be done outside of the Profiler constructor.
I believe the code of the constructor of Profiler is not thread safe, it has a publication problem. The method onEnd can be called by the profiler thread while the fields options and store are not fully initialized.
From another thread POV, a final field is only fully initialized after the call to the constructor not inside the call to the constructor.
See [1] for more.
Also the code is not just AOTed, Android is using profile guided AOT. After several days of usage, the code is AOTed with the profile collected from previous runs.
I don't have the same definition of security (i've read the JEP). Unlike TypeScript, you can not type the template values.
> built-in template processors, STR and FMT, don't do boxing ...
but all the others user-defined template processors (think a logger) are second class citizens and will do boxing.
Efficient String interpolation is hard without macros, that's why it's a macro in Rust.
This JEP tries to solve a harder problem, user defined template processors but do not provide the tool to make them efficient and never will. Are you suggesting that there is a JEP about macros in the making ?
You want the lexer to be able to make the difference between a constant string and a template string and you want users to be able to read the code.
This JEP solves the former not the later.
First, the lesson of Log4Shell have not been learnt. Allowing more libraries to do formatting, what can go wrong ?
And String.format() is slow because every values are boxed. This JEP repeats the same mistake with the templates.
For the anecdote, i know someone that was let go by IBM and hire by RedHat the same month two years ago.
For microservices, where you deals with data, it's quite effective because it works like typed JSON.
Go GC does not move objects in memory (mark and sweep) while other GCs (mark and compact) do, to avoid heap fragmentation and better throughput (see generational GCs).
One issue with mark and compact GCs is that you can not move the array of bytes during a system call. A ByteBuffer/Memory object, is an object that allocates its byte arrays using malloc, outside of the heap, so the bytes are not moved by the GC.
public record Lens<A, B>(Function<A, B> get, BiFunction<A, B, A> with) {
public <C> Lens<A, C> compose(Lens<B, C> inner) {
return new Lens<>(
inner.get.compose(get),
(a, c) -> with.apply(a, inner.with.apply(get.apply(a), c)));
}
}
Lens<Confirmation, LocalDateTime> $updatedOn =
new Lens<>(Confirmation::updateOn, Confirmation::updateOn); i = c()
print(i.a)
i.a = 42
print(i.a)And IMO, the semantics of any reactive APIs is better than just providing await.
Await serializes the async calls instead of running them concurrently. And too few C# devs are aware of/using the Task API.
https://en.wikipedia.org/wiki/Transformation_matrix#Affine_t...