Maximum Limelihood Estimator
Maximum Limelihood Estimator
MModular
Created by gryznar on 12/3/2023 in #questions
Error handling like in Rust
Important to distinguish exceptions from errors, I think. I wonder if Algebraic Effects Handling/Conditions are on the table?
11 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
The difference between the two is that Julia or Lisp let you capture and modify the AST directly. You're right that Lisp doesn't have a separate type to represent ASTs, but that's because in Lisp, every "statement" is a list, and the way you specify a program is by writing out the AST as a list; in other words, in Lisp, everything is an AST. (And all other data types are represented in terms of ASTs). Julia, Nim, and Dylan make the AST a bit less fundamental to the language, because they're all statement-based, but as the first step of compilation they transform the statements into an AST before handing the AST off to any macros for rewriting.
41 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
From what I can tell, it's still templates, just with a different syntax that's built into the language (Like Zig). But non-template metaprogramming hasn't been ruled out
41 replies
MModular
Created by Mengbo_Zhou on 11/1/2023 in #questions
Mojo in llm?
It doesn't even provide support for recursion yet 😅 so no, Mojo is nowhere near at the point where you could do large-scale LLM pretraining. AFAIK the only language that can do that is Python with C++
3 replies
MModular
Created by Kushagra on 11/3/2023 in #questions
Creating Syntactic Sugar
In Mojo, right now? No. But there's a lot of languages where you can--the relevant search term is syntactic macros, which are widely used in languages like Julia, Rust, and Lisp
2 replies
MModular
Created by jordiae on 10/30/2023 in #questions
Examples of Python code that will never work with Mojo?
@gabrieldemarmiesse it depends a lot on how compatible you want to be. The major problem is the C interface, which is deeply enmeshed with CPython interpreter internals. You can change these internals (which gives you solid, ~6x improvements in speed over Python without breaking anything outside of C modules), but that breaks standard packages like Pandas/PyTorch/NumPy/anything using C. This is basically what PyPy does. Alternatively, you can go for full compatibility using something like Cinder or Pyston for a ~2x speed improvement. But because they can't change any of the things that make Python slow (libraries depend on those), that's the most they can really do.
13 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
Oh gosh don't worry, you're totally fine :) I don't know much about OCaml or Haskell, but that sounds interesting. I'll make sure to check it out!
41 replies
MModular
Created by sryu1 on 10/27/2023 in #questions
Has anyone tried implementing Reinforcement Learning in mojo yet?
No; the language is in the extremely early stages. It's still working on basic features for a programming language, like objects, classes, methods, traits, etc. If you want to do RL right now, I'd suggest trying JAX or Torch.compile
4 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
Ahh, then yeah, it's not exclusive to Julia; Lisp, Dylan, and Nim have it too. But syntactic macros definitely aren't that common!
41 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
pragmas/annotations/decorators are all different from (much less general than) syntactic macros. Pragmas and annotations are just instructions to the compiler that have to be special-cased and can't be extended by the user, because they're part of the compiler itself. Decorators are a bit more flexible but still only let you wrap a function (you can't do anything that you couldn't do with a higher-order function). A macro takes code and represents it as a syntax tree of expressions, then rewrites the syntax tree into something else. This basically means you get to write your own compiler extensions to add new syntax, by translating one piece of syntax to another. With syntactic macros you can introduce any new syntax you'd like, but it stays limited to a local subset of your code where you applied the macro
41 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
The reason I say it's very Julia is because of the use of macros/syntax tree representations to rewrite this; it's definitely in the spirit of Lisps or Julia
41 replies
MModular
Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
It sounds like you're reinventing LoopVec/PythonSyntax.jl here 😆 Relatedly, I'd certainly love it if there were some way to get compatibility with Julia out of Mojo, so people could migrate from Julia to Mojo easily as well. There's tons of open-source code written for performance in Julia that could be ported over easily. (Unlike Python, where most code relies heavily on CPython internals that slow it down.)
41 replies
MModular
Created by Moosems / Three chickens on 10/25/2023 in #questions
Company Profitability
3 replies