a2svior
a2svior
MModular
Created by Shubham on 10/29/2024 in #questions
Using Mojo For Back-end Web Development
Sounds good, any feedback is helpful!
5 replies
MModular
Created by Shubham on 10/29/2024 in #questions
Using Mojo For Back-end Web Development
@Shubham I'm the author, let me know if you have any questions! There's also a very barebones beginning of a more fully-fledged API framework here with a django-like hello world example https://github.com/saviorand/lightbug_api
5 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Lightbug 0.1.5 Release just dropped! The most important contribution is by @bgreni - the HTTP client now follows redirects. We've also reorganized the code quite a bit and removed the client and server implementations that were calling into Python for socket interactions. It's all Mojo now :mojo: https://github.com/saviorand/lightbug_http/releases/tag/v0.1.5
70 replies
MModular
Created by Caroline on 10/17/2024 in #community-showcase
Modverse #43: MAX 24.5, our biggest Mojo update ever, and Mojo's debut in the TIOBE index
This is so comprehensive 👏 👏
9 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@msaelices we also have an open PR with @rd4com to add websockets to lightbug, in case you'd like to take a look: https://github.com/saviorand/lightbug_http/pull/57
70 replies
MModular
Created by AkaHenry on 10/14/2024 in #community-showcase
Rust FFI + Mojo: binding uuid-rs for Mojo
That's great! Thanks for making this!
13 replies
MModular
Created by rvs07 on 10/4/2024 in #questions
threading in mojo
here's a similar question i posted 9d ago , no answer yet but we had a little discussion with other folks : https://discord.com/channels/1087530497313357884/1288211437109383259
4 replies
MModular
Created by a2svior on 9/30/2024 in #questions
Runtime Reflection in Mojo?
Could you give an example of what we can do for reflection currently?
16 replies
MModular
Created by a2svior on 9/30/2024 in #questions
Runtime Reflection in Mojo?
I mean now without custom decorators there's not much we can do in terms of code generation either?
16 replies
MModular
Created by a2svior on 9/30/2024 in #questions
Runtime Reflection in Mojo?
I know there's Python.type() but that only works on PythonObjects. I want something of the sort for actual Mojo types
16 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Do you mean for HTML specifically or something general-purpose like https://pkg.go.dev/text/template ? For HTML I have some future plans but this will be in a separate library called lightbug_webthat will build on lightbug_http
70 replies
MModular
Created by sazid on 9/28/2024 in #questions
How to get unix timestamp?
can't say for sure about binaries, maybe other folks know more
23 replies
MModular
Created by sazid on 9/28/2024 in #questions
How to get unix timestamp?
Currently Morrow is not up-to-date with the latest Mojo version and small_time also has a nightly branch that's up-to-date with currently nightly. Also I think @toasty made small_time a bit smaller than Morrow in terms of functionality
23 replies
MModular
Created by sazid on 9/28/2024 in #questions
How to get unix timestamp?
@sazid also check out https://github.com/thatstoasty/small-time a fork of https://github.com/mojoto/morrow.mojo , those are both libraries for better time/date ergonomics on Mojo
23 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
@Peter Homola yup, some of the latest ones were posted by @bgreni here https://github.com/saviorand/lightbug_http/pull/61#issuecomment-2362104634
70 replies
MModular
Created by Peter Homola on 9/25/2024 in #community-showcase
JavaScript in Mojo
Nice!! This is definitely going to be very useful for web projects.
2 replies
MModular
Created by a2svior on 9/24/2024 in #questions
More details on `TaskGroup` and async
you probably saw this, right? @Owen Hilyard https://github.com/dmitry-salin/io_uring
8 replies
MModular
Created by Jack Clayton on 5/11/2024 in #community-showcase
Lightbug HTTP: Mojo web framework
Lightbug 0.1.4 Release just dropped! Headers are much more ergonomic in Lightbug 0.1.4 thanks to @bgreni 's contribution! There are now three options for specifying the headers that are accepted as input to HTTPRequest or HTTPResponse: 1. Assigning to headers directly:
var res = HTTPResponse()
res.headers["Connection"] = "keep-alive"
res.headers["Content-Type"] = "application/json"
var res = HTTPResponse()
res.headers["Connection"] = "keep-alive"
res.headers["Content-Type"] = "application/json"
2. Passing one or more instances of the Header struct to Headers:
var header = Headers(Header("Connection", "keep-alive"), Header("Content-Type", "application/json")
var res = HTTPResponse(headers)
var header = Headers(Header("Connection", "keep-alive"), Header("Content-Type", "application/json")
var res = HTTPResponse(headers)
3. Using the parse_raw method on Headers:
var headers_str = bytes(
"""GET /index.html HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 1234\r\nConnection: keep-alive\r\n\r\n"""
)
var header = Headers()
var b = Bytes(headers_str)
var reader = ByteReader(b^)
var method: String
var protocol: String
var uri: String
method, uri, protocol = header.parse_raw(reader)
var headers_str = bytes(
"""GET /index.html HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 1234\r\nConnection: keep-alive\r\n\r\n"""
)
var header = Headers()
var b = Bytes(headers_str)
var reader = ByteReader(b^)
var method: String
var protocol: String
var uri: String
method, uri, protocol = header.parse_raw(reader)
The headers can then be accessed as header["Content-Type"], "text/html" The codebase is also much more Pythonic now with refactors from @bgreni , with more use of dunder methods and direct string operations.
70 replies
MModular
Created by a2svior on 9/24/2024 in #questions
More details on `TaskGroup` and async
The use-case I have in mind is non-blocking networking in Lightbug. Potentially looking at implementing some simple analogue of Mio in Rust https://docs.rs/mio/1.0.2/mio/index.html , to that point also wondering if there is some event polling availiable in Mojo that we don't see in stdlib or if I have to rely on epoll/kqueue?
8 replies
MModular
Created by Peter Homola on 9/17/2024 in #community-showcase
Mojo web apps
@Peter Homola how can I make Lightbug better for your use case? Could you share some rough requirements?
7 replies